search for: getaddrecexpr

Displaying 11 results from an estimated 11 matches for "getaddrecexpr".

2013 Nov 13
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
...and the inner addrec are guaranteed to have no overflow. // // No self-wrap cannot be guaranteed after changing the step size, but // will be inferred if either NUW or NSW is true. Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW)); const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop, Flags); // If all of the other operands were loop invariant, we are done. if (Ops.size() == 1) return NewRec; I understand that you can't assume it won't wrap around with the new stride, but I couldn't find anything else later that would re-assign NSW/N...
2013 Nov 16
0
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
...guaranteed to have no overflow. > // > // No self-wrap cannot be guaranteed after changing the step size, but > // will be inferred if either NUW or NSW is true. > Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW)); > const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop, Flags); > > // If all of the other operands were loop invariant, we are done. > if (Ops.size() == 1) return NewRec; > > I understand that you can't assume it won't wrap around with the new stride, but I couldn't find anything else later t...
2013 Nov 16
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
On 16 November 2013 06:56, Andrew Trick <atrick at apple.com> wrote: > - getMulExpr constructs a new AddRec with NSW: > > Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW)); > const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop, Flags); > Hi Andrew, Thanks for looking at this. Clearing the flags here makes sense, but it's being too conservative. I'm thinking I'll need something like propagateSafeFlags(...) with knowledge of the loop induction ranges or something else instead of simply...
2018 Feb 08
2
[SCEV] Inconsistent SCEV formation for zext
...ropagated to this // AddRec. Negative step causes unsigned wrap, but it // still can't self-wrap. const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNW); // Return the expression with the addrec on the outside. return getAddRecExpr( getExtendAddRecStart<SCEVZeroExtendExpr>(AR, Ty, this, Depth + 1), getSignExtendExpr(Step, Ty, Depth + 1), L, AR->getNoWrapFlags()); } I believe it is wrong for ScalarEvolut...
2012 Dec 10
3
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
...Expr>(Accum)->getLoop() == L)) { SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap; @@ -3071,11 +3091,40 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) { } const SCEV *StartVal = getSCEV(StartValueV); - const SCEV *PHISCEV = getAddRecExpr(StartVal, Accum, L, Flags); + const SCEV *PHISCEV; + if (zext && trunc) { + // We have an induction variable 'iv' of the form: + // iv=add(zext(trunc(iv)), Accum) + // The basic strategy is to turn this into +...
2016 Apr 23
2
[IndVarSimplify] Narrow IV's are not eliminated resulting in inefficient code
...Build the new addrec. Propagate the NUW and NSW flags if both the > // outer add and the inner addrec are guaranteed to have no > overflow. > // Always propagate NW. > Flags = AddRec->getNoWrapFlags(setFlags(Flags, SCEV::FlagNW)); > const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRecLoop, Flags); > > // If all of the other operands were loop invariant, we are done. > if (Ops.size() == 1) return NewRec; > > Thanks! > -- Sanjoy > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.ll...
2018 Feb 10
0
[SCEV] Inconsistent SCEV formation for zext
...Negative step causes unsigned wrap, but it > > // still can't self-wrap. > > const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNW); > > // Return the expression with the addrec on the outside. > > return getAddRecExpr( > > getExtendAddRecStart<SCEVZeroExtendExpr>(AR, Ty, this, > > Depth + 1), > > getSignExtendExpr(Step, Ty, Depth + 1), L, > > AR->getNoWrapFlags()); > >...
2016 Apr 20
2
[IndVarSimplify] Narrow IV's are not eliminated resulting in inefficient code
​Hi, Would you be able to kindly check and assist with the IndVarSimplify / SCEV problem I got in the latest LLVM, please? Sometimes IndVarSimplify may not eliminate narrow IV's when there actually exists such a possibility. This may affect other LLVM passes and result in inefficient code. The reproducing test 'indvar_test.cpp' is attached. The problem is with the second
2013 Nov 16
0
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
...at linaro.org> wrote: > >> On 16 November 2013 06:56, Andrew Trick <atrick at apple.com> wrote: >> - getMulExpr constructs a new AddRec with NSW: >> >> Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW)); >> const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop, Flags); > > Hi Andrew, > > Thanks for looking at this. > > Clearing the flags here makes sense, but it's being too conservative. I'm thinking I'll need something like propagateSafeFlags(...) with knowledge of the loop induction ranges or somethin...
2018 May 10
2
LLVM SCEV isAddRecNeverPoison and strength reduction
+CC llvm-dev On Tue, May 8, 2018 at 2:34 AM, Gal Zohar <Gal.Zohar at ceva-dsp.com> wrote: > I noticed that SCEV, when trying to perform strength reduction, doesn’t use > the ability to prove an induction variable does not signed/unsigned wrap due > to infinite loops. > > Is there an easy way to use the isAddRecNeverPoison function when > determining if strength reduction
2018 Feb 11
2
[SCEV] Inconsistent SCEV formation for zext
...tive step causes unsigned wrap, but it > > // still can't self-wrap. > > const_cast<SCEVAddRecExpr > *>(AR)->setNoWrapFlags(SCEV::FlagNW); > > // Return the expression with the addrec on the outside. > > return getAddRecExpr( > > getExtendAddRecStart<SCEVZeroExtendExpr>(AR, Ty, this, > > Depth + 1), > > getSignExtendExpr(Step, Ty, Depth + 1), L, > > AR->getNoWrapFlags()); > >...