[llvm] r365053 - [SCEV] Preserve flags on add/muls in getSCEVATScope

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 09:34:08 PDT 2019


Author: reames
Date: Wed Jul  3 09:34:08 2019
New Revision: 365053

URL: http://llvm.org/viewvc/llvm-project?rev=365053&view=rev
Log:
[SCEV] Preserve flags on add/muls in getSCEVATScope

We haven't changed the set of users, just specialized an operand for those users.  Given that, the previous wrap flags must still be correct.

Sorry for the lack of test case.  Noticed this while working on something else, and haven't figured out to exercise this standalone.


Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=365053&r1=365052&r2=365053&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jul  3 09:34:08 2019
@@ -8243,9 +8243,9 @@ const SCEV *ScalarEvolution::computeSCEV
           NewOps.push_back(OpAtScope);
         }
         if (isa<SCEVAddExpr>(Comm))
-          return getAddExpr(NewOps);
+          return getAddExpr(NewOps, Comm->getNoWrapFlags());
         if (isa<SCEVMulExpr>(Comm))
-          return getMulExpr(NewOps);
+          return getMulExpr(NewOps, Comm->getNoWrapFlags());
         if (isa<SCEVMinMaxExpr>(Comm))
           return getMinMaxExpr(Comm->getSCEVType(), NewOps);
         llvm_unreachable("Unknown commutative SCEV type!");




More information about the llvm-commits mailing list