[PATCH] D127801: [InstCombine] convert mask and shift of power-of-2 to cmp+select

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 00:55:04 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LG from my side. I don't think the differences in backend codegen are bad enough that we would even bother with a reverse transform at this point. We can reevaluate matching a more complex pattern if it becomes an issue.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1917
 
+    // When the mask is a power-of-2 constant and op0 is a shifted-power-of-2
+    // constant, test if the shift amount equals the offset bit index:
----------------
op0 -> Op0


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127801/new/

https://reviews.llvm.org/D127801



More information about the llvm-commits mailing list