[PATCH] D131142: [InstCombine] Canonicalize "and, add", "or, add", "xor, add"

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 22:47:04 PDT 2022


bcl5980 added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1810
+  Value *NewBinOp = Builder.CreateBinOp(OpC, X, ConstantInt::get(Ty, *C));
+  return BinaryOperator::CreateAdd(NewBinOp, ConstantInt::get(Ty, *C2));
+}
----------------
I still insist we should add the nsw/nuw flags here as this transform is really easy case to pass the flags.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131142



More information about the llvm-commits mailing list