if C1 and C3 are pow2 and Log2(C3) >= C2:
((C1 >> X) << C2) & C3 -> X == (Log2(C1)+C2-Log2(C3)) ? C3 : 0
Paths
| Differential D127469
[InstCombine] Optimize lshr+shl+and conversion pattern ClosedPublic Authored by bcl5980 on Jun 9 2022, 8:09 PM.
Details Summary if C1 and C3 are pow2 and Log2(C3) >= C2: ((C1 >> X) << C2) & C3 -> X == (Log2(C1)+C2-Log2(C3)) ? C3 : 0
Diff Detail
Unit TestsFailed
Event TimelineComment Actions I don't like increasing risk by combining what are really 2 independent changes into 1 patch. This revision is now accepted and ready to land.Jun 13 2022, 7:23 AM This revision was landed with ongoing or failed builds.Jun 13 2022, 8:06 PM Closed by commit rG286198ff043a: [InstCombine] Optimize lshr+shl+and conversion pattern (authored by bcl5980). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 436141 llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/and.ll
|