To generate simplified IR, make sure fold
(X & signbit) ==/!= 0) -> X s>=/s< 0;
is scheduled before fold
((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.
Paths
| Differential D63026
[InstCombine] Fold icmp eq/ne (and %x, signbit), 0 -> %x s>=/s< 0 earlier ClosedPublic Authored by huihuiz on Jun 7 2019, 2:12 PM.
Details Summary To generate simplified IR, make sure fold (X & signbit) ==/!= 0) -> X s>=/s< 0; is scheduled before fold ((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.
Diff Detail Event Timelinelebedev.ri retitled this revision from [InstCombine] Fix fold order for icmp pred (and (sh X, Y), C), 0. to [InstCombine] Fold icmp eq/ne (and %x, signbit), 0 -> %x s>=/s< 0 earlier.Jun 16 2019, 4:27 PM Comment ActionsYep, first fold looks good, some nits.
huihuiz marked 4 inline comments as done.
Comment Actions I think this looks good now, thank you for working on this!
This revision is now accepted and ready to land.Jun 18 2019, 10:53 AM huihuiz marked an inline comment as done. Comment Actionsthis differential update address inline comment - adding comment for restriction this fold to single-use 'and' (PR10267) Closed by commit rL363845: [InstCombine] Fold icmp eq/ne (and %x, signbit), 0 -> %x s>=/s< 0 earlier (authored by huihuiz). · Explain WhyJun 19 2019, 10:28 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 204435 lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/lshr-and-negC-icmpeq-zero.ll
test/Transforms/InstCombine/lshr-and-signbit-icmpeq-zero.ll
test/Transforms/InstCombine/shl-and-negC-icmpeq-zero.ll
test/Transforms/InstCombine/shl-and-signbit-icmpeq-zero.ll
|
Can you please link the patch to which you split this out?