[PATCH] D130080: [InstCombine] Change order of canonicalization of ADD and AND

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 06:30:43 PDT 2022


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1850
+      // (X + 16) & -4 --> (X & -4) + 16
+      if (Op0->hasOneUse() && C->isNegative() && C->isShiftedMask() &&
+          *AddC == (*AddC & *C)) {
----------------
C->isNegatedPowerOf2() ?


================
Comment at: llvm/test/Transforms/InstCombine/or.ll:157
 
 define i32 @test21(i32 %t1) {
 ; CHECK-LABEL: @test21(
----------------
Please put a TODO note on this test that says this could reduce to t1+2.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130080



More information about the llvm-commits mailing list