[PATCH] D148084: [SCEV] Preserve NSW for AddRec multiplied by -1 if it cannot be signed minimum

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 02:47:29 PDT 2023


nikic added a comment.

Can you pleas rebase this to current main? It doesn't apply cleanly.



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:3203
+              APInt::getSignedMinValue(getTypeSizeInBits(AddRec->getType()));
+          if (getSignedRangeMin(AddRec) != MinInt)
+            FlagsMask = setFlags(FlagsMask, SCEV::FlagNSW);
----------------
No need to check this if there's no nsw flag in the first place?


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

https://reviews.llvm.org/D148084



More information about the llvm-commits mailing list