search for: getscev

Displaying 20 results from an estimated 88 matches for "getscev".

2016 Oct 17
2
[SCEV] inconsistent operand ordering
...= icmp eq i32 %inc, %n br i1 %exitcond, label %for.end.loopexit, label %for.body for.end.loopexit: ; preds = %for.body br label %for.end for.end: ; preds = %for.end.loopexit, %entry ret void } For this IR, if I call getSCEV() in the following order- 1) getSCEV(%q.012) 2) getSCEV(%add.ptr2) 3) getSCEV(%q.012) The output I get is this- {((%a * %b) + %arr)<nsw>,+,%b}<nw><%for.body> {(((1 + %a) * %b) + %arr),+,%b}<nw><%for.body> %q.012 Please note that we are getting a different SCEV for %...
2017 Aug 08
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
...>> For reference, below is a reduced loop where this problem occurs. The SCEV for %i.07.i will have <nuw> or not depending on whether %idxprom.i was computed before it: > > %idxprom.i, the zext? I'm not sure how you're getting that particular effect. ScalarEvolution::getSCEV for a zext immediately calls getSCEV on its operand. Here is an abridged record of the getSCEV results as seen by each pass with/without preserving SCEVAnalysis. In the first case, when the SCEV is invalidated, the SCEV for %i.07.i is computed in LSR as {0,+,1}<%for.body.i>. In the second c...
2017 Aug 08
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
Hi all, I'm looking into resolving a FIXME in the LoopDataPrefetch (and FalkorMarkStridedAccesses) pass by marking both of these passes as preserving the ScalarEvolution analysis. Unfortunately, when this change is made, LSR will generate different code. One of the root causes seems to be that SCEV will return different nsw/nuw flags for the same Value, depending on what order the
2011 Nov 21
4
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...ne? >> I tried for a while but I wasn't able to trigger that > > Hi Marcello, > > the SCEV returns SCEVCouldNotCompute in case it cannot analyze an expression > or if the analysis would be to complicated. I am currently > not sure if this may actually happen when calling getSCEV(), because > getSCEV() could just return a SCEVUnknown referencing the Value itself. > Maybe SCEVCouldNotCompute is just generated by functions like > SE->getBackedgeTakenCount()? > > In case you cannot generate a test case that yields to this, I don't think > there is a ne...
2018 Feb 11
2
[SCEV] Inconsistent SCEV formation for zext
...d(Key)) { PessimisticMode = true; return Value; } else if (FinalCache.find(Key)) { return Value; } Insertion logic is like this- If (PessimisticMode) { PendingCache.insert(Entry); } else { FinalCache.insert(Entry); } We need to distinguish top level calls to the external interface like getSCEV()/getBackedgeTakenCount() etc from the internal recursive calls for setting/resetting the state correctly. We start with adding the most conservative result for the value in PendingCache. This would be getUnknown() for getSCEV(). So getSCEV() may be implemented something like this- ScalarEvoluti...
2011 Nov 11
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...Finkel wrote: Talking about this I >>>> looked again into ScalarEvolution. >>>> >>>> To analyze a load, you would do: >>>> >>>> LoadInst *Load = ... Value *Pointer = Load->getPointer(); const >>>> SCEV *PointerSCEV = SE->getSCEV(Pointer); const SCEVUnknown >>>> *PointerBase = >>>> dyn_cast<SCEVUnknown>(SE->getPointerBase(PointerSCEV)); >>>> >>>> if (!PointerBase) return 'Analysis failed' >>>> >>>> const Value *BaseValue = PointerBase-&...
2011 Nov 11
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...Hal Finkel wrote: > >> Talking about this I looked again into ScalarEvolution. > >> > >> To analyze a load, you would do: > >> > >> LoadInst *Load = ... > >> Value *Pointer = Load->getPointer(); > >> const SCEV *PointerSCEV = SE->getSCEV(Pointer); > >> const SCEVUnknown *PointerBase = > >> dyn_cast<SCEVUnknown>(SE->getPointerBase(PointerSCEV)); > >> > >> if (!PointerBase) > >> return 'Analysis failed' > >> > >> const Value *BaseValue = PointerBase-...
2009 Jun 24
1
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...mple, int foo(int s) { int * p = malloc(s * sizeof int); ... int q = p[s - 2]; } then the access of p[s - 2] always stays in bound. I implemented a prototype using the Scalar Evolution pass. Here are the pseudo-code of the implementation: const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); const SCEV * bounds = SE->getSCEV(objSize); if (SE->getSMaxExpr(offset, bounds) == bounds) { ++safeGEPs; } But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, N-2). My question is, is there a plan to support something like this, or is it possib...
2011 Nov 21
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...dNotCompute from the SCEV engine? > I tried for a while but I wasn't able to trigger that Hi Marcello, the SCEV returns SCEVCouldNotCompute in case it cannot analyze an expression or if the analysis would be to complicated. I am currently not sure if this may actually happen when calling getSCEV(), because getSCEV() could just return a SCEVUnknown referencing the Value itself. Maybe SCEVCouldNotCompute is just generated by functions like SE->getBackedgeTakenCount()? In case you cannot generate a test case that yields to this, I don't think there is a need to try more. Even without...
2017 Aug 09
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
Hi, On Tue, Aug 8, 2017 at 12:58 PM, Friedman, Eli <efriedma at codeaurora.org> wrote: > Oh, I see... yes, we do stupid things involving mutating NoWrap flags after > a SCEV is created. (grep for setNoWrapFlags in ScalarEvolution.cpp.) That's really a compile time hack -- we defer some expensive tricks to prove nsw/nuw on an add recurrences to when we've been asked to
2016 Oct 04
2
Getting the symbolic expression for an address calculation
How do you generate a SCEVAddRecExpr from a SCEV? It tried dyn_casting and it seems like that the SCEV returned by getSCEV is not a SCEVAddRecExpr. Thanks On Fri, Sep 30, 2016 at 4:16 PM, Friedman, Eli <efriedma at codeaurora.org> wrote: > On 9/30/2016 12:16 PM, Charith Mendis via llvm-dev wrote: > >> >> Hi all, >> >> What is the best way to get the symbolic expression for an addr...
2011 Dec 04
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
...a while but I wasn't able to trigger that >> >> Hi Marcello, >> >> the SCEV returns SCEVCouldNotCompute in case it cannot analyze an expression >> or if the analysis would be to complicated. I am currently >> not sure if this may actually happen when calling getSCEV(), because >> getSCEV() could just return a SCEVUnknown referencing the Value itself. >> Maybe SCEVCouldNotCompute is just generated by functions like >> SE->getBackedgeTakenCount()? >> >> In case you cannot generate a test case that yields to this, I don't thin...
2018 Feb 20
0
[SCEV] Inconsistent SCEV formation for zext
...e if (FinalCache.find(Key)) { > return Value; > } > > Insertion logic is like this- > > If (PessimisticMode) { > PendingCache.insert(Entry); > } else { > FinalCache.insert(Entry); > } > > We need to distinguish top level calls to the external interface like getSCEV()/getBackedgeTakenCount() etc from the internal recursive calls for setting/resetting the state correctly. We start with adding the most conservative result for the value in PendingCache. This would be getUnknown() for getSCEV(). > > So getSCEV() may be implemented something like this- > &...
2016 Oct 18
2
[SCEV] inconsistent operand ordering
...gt; > /br i1 %exitcond, label %for.end.loopexit, label %for.body/ > > // > > /for.end.loopexit: ; preds = %for.body/ > > /br label %for.end/ > > // > > /for.end: ; preds = %for.end.loopexit, %entry/ > > /ret void/ > > /}/ > > For this IR, if I call getSCEV() in the following order- > > *1) getSCEV(%q.012)* > > 2) getSCEV(%add.ptr2) > > *3) getSCEV(%q.012)* > > The output I get is this- > > *{((%a * %b) + %arr)<nsw>,+,%b}<nw><%for.body>* > > {(((1 + %a) * %b) + %arr),+,%b}<nw><%for.body&gt...
2009 Jun 24
2
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...- 2]; > > } > > > > then the access of p[s - 2] always stays in bound. > > > > I implemented a prototype using the Scalar Evolution pass. Here are the > > pseudo-code of the implementation: > > > > const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); > > const SCEV * bounds = SE->getSCEV(objSize); > > > > if (SE->getSMaxExpr(offset, bounds) == bounds) { > > ++safeGEPs; > > } > > > > But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, > > N-2)....
2011 Nov 21
2
[LLVMdev] How to make Polly ignore some non-affine memory accesses
Sorry for the noobish question, but what kind of subscripts generate a SCEVCouldNotCompute from the SCEV engine? I tried for a while but I wasn't able to trigger that. 2011/11/20 Tobias Grosser <tobias at grosser.es>: > On 11/20/2011 03:01 AM, Marcello Maggioni wrote: >> >> 2011/11/19 Tobias Grosser<tobias at grosser.es>: >>> >>> On 11/18/2011
2009 Jun 24
0
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...eof int); > ... > int q = p[s - 2]; > } > > then the access of p[s - 2] always stays in bound. > > I implemented a prototype using the Scalar Evolution pass. Here are the > pseudo-code of the implementation: > > const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); > const SCEV * bounds = SE->getSCEV(objSize); > > if (SE->getSMaxExpr(offset, bounds) == bounds) { > ++safeGEPs; > } > > But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, > N-2). Consider 8-bit integers and N = -127. N...
2009 Jun 24
4
[LLVMdev] killing vicmp and vfcmp
Now that icmp and fcmp have supported returning vectors of i1 for a while, I think it's time to remove the vicmp and vfcmp instructions from LLVM. The good news is that we've never shipped a release that included them so we won't be providing auto-upgrade support. There is some existing backend support for vicmp and vfcmp that looks different from what icmp and fcmp do. If this
2018 Feb 10
0
[SCEV] Inconsistent SCEV formation for zext
Hi, +CC Max, Serguei This looks like a textbook case of why caching is hard. We first call getZeroExtendExpr on %dec, and this call does end up returning an add rec. However, in the process of simplifying the zext, it also calls into isLoopBackedgeGuardedByCond which in turn calls getZeroExtendExpr(%dec) again. However, this second (recursive) time, we don't simplify the zext and cache a
2016 Sep 30
2
Getting the symbolic expression for an address calculation
Hi all, What is the best way to get the symbolic expression for an address calculation in llvm specially when memory addresses are calculated within a loop. Use case: I want to know what loop induction variables are used for a particular address calculation and in what symbolic context. Thereby, I want to identify which stores and loads will be contiguous in memory if I unroll each of the