[PATCH] D132412: [InstCombine] ease use constraint in tryFactorization()

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 01:41:43 PDT 2022


Allen added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/sub.ll:2007
+; x * y - x --> (y - 1) * x
+; TODO: The mul could retain nsw.
+
----------------
bcl5980 wrote:
> Allen wrote:
> > sorry for the naive question, does the nsw of mul implies that of add? As you just say the mul could retain nsw. 
> https://alive2.llvm.org/ce/z/WjpNoD
> add pattern can't retain nsw. overflow comes from -1 * INT_MIN
Thanks @bcl5980,  as your case showed, the mul pattern also can't retain nsw ? 


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

https://reviews.llvm.org/D132412



More information about the llvm-commits mailing list