From: Philip Reames Date: Wed, 3 Jul 2019 16:34:08 +0000 (+0000) Subject: [SCEV] Preserve flags on add/muls in getSCEVATScope X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=908adc62add0f169d7a4b1877c8e7a410e27464f;p=llvm [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365053 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index a66e609e4ee..4a98fc537a5 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -8243,9 +8243,9 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) { NewOps.push_back(OpAtScope); } if (isa(Comm)) - return getAddExpr(NewOps); + return getAddExpr(NewOps, Comm->getNoWrapFlags()); if (isa(Comm)) - return getMulExpr(NewOps); + return getMulExpr(NewOps, Comm->getNoWrapFlags()); if (isa(Comm)) return getMinMaxExpr(Comm->getSCEVType(), NewOps); llvm_unreachable("Unknown commutative SCEV type!");