[PATCH] D138814: [InstCombine] Combine a/lshr of add -> uadd.with.overflow

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 01:59:48 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp:916
+  // Replace the use of `Op0` by `I` with `Overflow`.
+  return new ZExtInst(Overflow, Ty);
+}
----------------
This is incorrect in the i2/i1 case: https://alive2.llvm.org/ce/z/ga8CDx

Using sext if the original shift was ashr will fix it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138814



More information about the llvm-commits mailing list