[PATCH] D35256: [SCEV] Try harder to preserve NSW information for sext(sub) expressions

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 29 22:32:35 PDT 2017


sanjoy requested changes to this revision.
sanjoy added a comment.
This revision now requires changes to proceed.

Sorry for the delay, this one somehow slipped through the cracks.



================
Comment at: lib/Analysis/ScalarEvolution.cpp:5627
   case Instruction::SExt:
+    if (auto *BO = dyn_cast<BinaryOperator>(U->getOperand(0))) {
+      // The NSW flag of a subtract does not always survive the conversion to
----------------
Can you please use `MatchBinaryOp` here?  That'll catch more cases than a literal `sub` instruction.


Repository:
  rL LLVM

https://reviews.llvm.org/D35256





More information about the llvm-commits mailing list