search for: scevconstant

Displaying 20 results from an estimated 41 matches for "scevconstant".

2012 Apr 17
0
[LLVMdev] arithmetic with SCEVs, SCEVConsts, ConstInts, and APInts
Hi, Pondering the code for StrongSIV and trying to write my own, I find I have many questions. In this code, for example, * if (isa<SCEVConstant>(delta) && isa<SCEVConstant>(srcCoeff)) { const SCEVConstant *constDelta = cast<SCEVConstant>(delta); const SCEVConstant *constCoeff = cast<SCEVConstant>(srcCoeff); APInt distance, remainder; APInt::sdivrem(constDelta->getValue()->getValue(),...
2018 May 09
2
ScalarEvolution questions
...find the min among them. Found an existing function(getMinFromExprs) in LoopAccessAnalysis which compares two SCEVs. getMinFromExprs function finds the diff between two SCEV's and then checks for the negative value to find the minimum. While checking the negative value it specifically look for SCEVConstant. Do we have anything to find the min in case of NON-SCEVConstant (with some additional information), i.e.: SCEV1: (sext i32 (-1 + %n.addr.0) to i64) SCEV2: 0 Extra information "n.addr.0 > 1" 2) How to feed the relational information to SCEV, i.e. "a > b". This relational...
2018 May 10
0
ScalarEvolution questions
...Found an existing function(getMinFromExprs) in LoopAccessAnalysis which > compares two SCEVs. > > getMinFromExprs function finds the diff between two SCEV’s and then checks > for the negative value to find the minimum. > > While checking the negative value it specifically look for SCEVConstant. > > Do we have anything to find the min in case of NON-SCEVConstant (with some > additional information), i.e.: > > SCEV1: (sext i32 (-1 + %n.addr.0) to i64) > > SCEV2: 0 > > Extra information “n.addr.0 > 1” There is ScalarEvolution::isImpliedCond -- using it you can...
2018 May 10
2
ScalarEvolution questions
...und an existing function(getMinFromExprs) in LoopAccessAnalysis > which compares two SCEVs. > > getMinFromExprs function finds the diff between two SCEV’s and then > checks for the negative value to find the minimum. > > While checking the negative value it specifically look for SCEVConstant. > > Do we have anything to find the min in case of NON-SCEVConstant (with > some additional information), i.e.: > > SCEV1: (sext i32 (-1 + %n.addr.0) to i64) > > SCEV2: 0 > > Extra information “n.addr.0 > 1” There is ScalarEvolution::isImpliedCond -- using it you ca...
2015 Jan 15
4
[LLVMdev] confusion w.r.t. scalar evolution and nuw
...volution::getUnsignedRange, the following code could fire: if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) { // If there's no unsigned wrap, the value will never be less than its // initial value. if (AddRec->getNoWrapFlags(SCEV::FlagNUW)) if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart())) if (!C->getValue()->isZero()) ConservativeResult = ConservativeResult.intersectWith( ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0))); and conclude that %idx.dec is always...
2018 May 16
0
ScalarEvolution questions
...und an existing function(getMinFromExprs) in LoopAccessAnalysis > which compares two SCEVs. > > getMinFromExprs function finds the diff between two SCEV’s and then > checks for the negative value to find the minimum. > > While checking the negative value it specifically look for SCEVConstant. > > Do we have anything to find the min in case of NON-SCEVConstant (with > some additional information), i.e.: > > SCEV1: (sext i32 (-1 + %n.addr.0) to i64) > > SCEV2: 0 > > Extra information “n.addr.0 > 1” There is ScalarEvolution::isImpliedCond -- using it you ca...
2008 Jun 10
2
[LLVMdev] SCEV Question
Is there a document describing the guts of SCEV anywhere? I have a simple question. When looking at a linear SCEVAddRecExpr with a constant step recurrence (that is, getStepRecurrence returns SCEVConstant), is the constant in terms of bytes or in terms of "index," in that the byte offset is calculated by taking the step and multiplying it by the data size of any memory operation its used in. In this case, I have a load address and I call SE.getSCEV(Addr). That returns the linear recurren...
2017 Nov 20
2
Nowaday Scalar Evolution's Problem.
...Keep analyze it! we are going to calculate later when calculating backedge-taken count! (%1 == 7) = SCEVConditional(%1 == 7) What is second operand value? : %4 What is %4 value? : Constant 1 %4 = SCEVConstant(1) %3 = SCEVConditional(%1 == 7) + SCEVConstant(1) %3 = SCEVAddRecExpr[%1, +, SCEVConditional(%1 == 7) +, SCEVConstant(1))] %2 = SCEVAddRecExpr[%1, +, SCEVConditional(%1 == 4), +, %3)] %1 = %2 What is Latch conditional(%5) value? : %1 Done Node Analy...
2018 May 16
1
ScalarEvolution questions
...on(getMinFromExprs) in LoopAccessAnalysis >> which compares two SCEVs. >> >> getMinFromExprs function finds the diff between two SCEV’s and then >> checks for the negative value to find the minimum. >> >> While checking the negative value it specifically look for SCEVConstant. >> >> Do we have anything to find the min in case of NON-SCEVConstant (with >> some additional information), i.e.: >> >> SCEV1: (sext i32 (-1 + %n.addr.0) to i64) >> >> SCEV2: 0 >> >> Extra information “n.addr.0 > 1” > > There is Scala...
2011 Nov 11
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...V *Offset = SE->getMinusSCEV(PointerOneSCEV, PointerTwoSCEV); // Now we devide it by the element size Type *AllocTy = LoadOne->getType()->getAllocTy(); const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); if (const SCEVConstant *IntOffsetSCEV = dyn_cast<SCEVConstant>(OffsetInElements)) { ConstantInt *IntOffset = IntOffsetSCEV->getValue() return IntOffset; } else { return "This seems to be a complicated offset"; } const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); Let me k...
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
...; --- > EliminatePointerRecurrence(LI, L, PN, Preheader, DeadInsts); 626c643 < runOnLoop(*I); --- > runOnLoop(LI,*I); 652,653c669,670 < if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) < if (AR->getNumOperands() == 2 && isa<SCEVConstant>(AR->getOperand(1))) --- > if (1)//SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) > if (1)//AR->getNumOperands() == 2 && isa<SCEVConstant>(AR->getOperand(1))) Naftali
2011 Nov 11
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Fri, 2011-11-11 at 23:55 +0100, Tobias Grosser wrote: > On 11/11/2011 11:36 PM, Hal Finkel wrote: > > On Thu, 2011-11-10 at 23:07 +0100, Tobias Grosser wrote: > >> On 11/08/2011 11:29 PM, Hal Finkel wrote: > >> Talking about this I looked again into ScalarEvolution. > >> > >> To analyze a load, you would do: > >> > >> LoadInst *Load
2018 May 01
0
LSR formula rating
...uppose this could apply to other target with hardware loop support. 2. C.SetupCost What it the motivation behind this code? // Rough heuristic; favor registers which don't require extra setup // instructions in the preheader. if (!isa<SCEVUnknown>(Reg) && !isa<SCEVConstant>(Reg) && !(isa<SCEVAddRecExpr>(Reg) && (isa<SCEVUnknown>(cast<SCEVAddRecExpr>(Reg)->getStart()) || isa<SCEVConstant>(cast<SCEVAddRecExpr>(Reg)->getStart())))) ++C.SetupCost; I'd imagine that this accounts for...
2008 Jun 10
0
[LLVMdev] SCEV Question
...take a look at this article: http://citeseer.ist.psu.edu/vanengelen00symbolic.html I'm not aware of any LLVM-specific document describing SCEV. > I have a simple question. When looking at a linear SCEVAddRecExpr > with a constant step recurrence (that is, getStepRecurrence returns > SCEVConstant), is the constant in terms of bytes or in terms of "index," > in that the byte offset is calculated by taking the step and multiplying it > by the data size of any memory operation its used in. SCEV expressions are orthogonal to memory operations. They just describe (in a finite wa...
2011 Nov 15
3
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...nterOneSCEV, PointerTwoSCEV); > > // Now we devide it by the element size > Type *AllocTy = LoadOne->getType()->getAllocTy(); > const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); > const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); > > if (const SCEVConstant *IntOffsetSCEV > = dyn_cast<SCEVConstant>(OffsetInElements)) { > ConstantInt *IntOffset = IntOffsetSCEV->getValue() > return IntOffset; > } else { > return "This seems to be a complicated offset"; > } > > const SCEV *OffsetInElements = SE->ge...
2018 May 30
1
Help on finding Base GEP
...h will see through bitcasts and GEPs, so it > should give an expression of the form (base + offset) on the pointer > of the load. Specifically, you can use ScalarEvolution to subtract the expression for the base descriptor from the expression for the loaded pointer and see if the result is a SCEVConstant. Also, you might find GetPointerBaseWithConstantOffset (in ValueTracking.h) useful.  -Hal > > Cheers > siddharth > > On Wed 30 May, 2018, 16:30 Venkataramanan Kumar via llvm-dev, > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > >...
2005 Jul 29
0
[LLVMdev] patch for pointer-to-array conversion
...ut expensive multiply instructions inside // of the loop. For now just disable indvar subst on anything more // complex than a linear addrec. - if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) - if (AR->getNumOperands() == 2 && isa<SCEVConstant>(AR->getOperand(1))) + if (1)//SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) + if (1)//AR->getNumOperands() == 2 && isa<SCEVConstant>(AR->getOperand(1))) IndVars.push_back(std::make_pair(PN, SCEV)); } }
2011 Nov 16
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...> > > // Now we devide it by the element size > > Type *AllocTy = LoadOne->getType()->getAllocTy(); > > const SCEV *TypeOfSCEV = SE->getSizeOfExpr(AllocTy); > > const SCEV *OffsetInElements = SE->getUDivExpr(Offset, TypeOfSCEV); > > > > if (const SCEVConstant *IntOffsetSCEV > > = dyn_cast<SCEVConstant>(OffsetInElements)) { > > ConstantInt *IntOffset = IntOffsetSCEV->getValue() > > return IntOffset; > > } else { > > return "This seems to be a complicated offset"; > > } > > > >...
2005 Jul 28
0
[LLVMdev] help with pointer-to-array conversion
...ence(LI, L, PN, Preheader, DeadInsts); > 626c643 > < runOnLoop(*I); > --- >> runOnLoop(LI,*I); > 652,653c669,670 > < if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) > < if (AR->getNumOperands() == 2 && > isa<SCEVConstant>(AR->getOperand(1))) > --- >> if (1)//SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV)) >> if (1)//AR->getNumOperands() == 2 && > isa<SCEVConstant>(AR->getOperand(1))) > > Naftali > > _______________________________...
2013 Nov 02
1
[LLVMdev] LICM and SCEV AA?
...ne array element dependence. It should have a strong method for dependence analysis. Why does it miss this case? Like you said it *should*. The simple dependence analysis we currently have works by pair wise comparing (subtracting) the access SCEVS. It currently only handles constant dependences (SCEVConstant) The resulting distance from Hal's example is {4,+,4} ReadWrite and so should be safe. We just don't handle this case yet. Best, Arnold