[PATCH] D107552: [InstCombine] Combine lshr of add that intends to get the carry as llvm.uadd.with.overflow

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 09:54:08 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp:1105
+    for (TruncInst *Trunc : Truncs) {
+      Trunc->replaceAllUsesWith(UAdd);
+    }
----------------
craig.topper wrote:
> We probably need to do something here to schedule the dead truncates to revisited to remove them. But I'm not sure.
I think this should use InstCombinerImpl::replaceInstUsesWith rather than Instruction::replaceAllUsesWith. Then I think it should call InstCombinerImpl::eraseInstFromFunction.

@spatel or @lebedev.ri does that sound right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107552



More information about the llvm-commits mailing list