[PATCH] D63528: InstCombine: Preserve nuw when reassociating nuw ops [3/3]

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 06:54:57 PDT 2019


lebedev.ri added a comment.

Can this end up producing anything other than mul-of-add that we care about?
https://rise4fun.com/Alive/WtnX



================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:595
     // Check if we can add NSW flag to SimplifiedInst. If so, set NSW flag.
     // TODO: Check for NUW.
     if (BinaryOperator *BO = dyn_cast<BinaryOperator>(SimplifiedInst)) {
----------------
Outdated comment?


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:628-629
+              BO->setHasNoSignedWrap(HasNSW);
+            BO->setHasNoUnsignedWrap(HasNUW);
+          }
       }
----------------
Why is this restricted to `m_APInt()`?
https://rise4fun.com/Alive/WtnX


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

https://reviews.llvm.org/D63528





More information about the llvm-commits mailing list