search for: scalarevolution

Displaying 20 results from an estimated 497 matches for "scalarevolution".

2018 Aug 11
3
ScalarEvolution in a ModulePass
Hey LLVMDev, I'm working on a ModulePass that uses ScalarEvolution along with several other analyses. After some debugging, it looks to me like ScalarEvolutionWrapperPass does not handle memory correctly for this case. Here's my current understanding of the problem. ScalarEvolutionWrapperPass maintains a unique_ptr to a ScalarEvolution. Calling getSE() deref...
2018 Jan 16
0
Running Scalar Evolution on Modules on an ad-hoc basis
...l modules thus processed. Ideally I don't want to do it as an LTO pass -- I don't know which modules I need to check at the time the program starts running. My current attempt at an MVP is attached. However, it segfaults on line 41. My suspicion is that the prerequisite passes that ScalarEvolution relies on aren't being run, but I could be entirely mistaken on this. Can anyone give me a pointer toward how to do this correctly? Thank you! Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/2...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
Attached 2012/2/8 Marcello Maggioni <hayarms at gmail.com>: > Mmm, sorry, the patch I posted crashes if ExitBr is null (which it may > be ...) , this one should be ok (and passess all the ScalarEvolution > tests in LLVM): > > diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp > index daf7742..b10fab2 100644 > --- a/lib/Analysis/ScalarEvolution.cpp > +++ b/lib/Analysis/ScalarEvolution.cpp > @@ -4293,9 +4293,15 @@ ScalarEvolution::ComputeExitLimit(co...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...ple fortran loops with gfortran-4.6 + DragonEgg 3.0. Even for simple double loops like this one: program test2 integer i,j,k dimension k(100,100) do j=1,100 do i=1,100 k(i,j) = i enddo enddo write(*,*) k(1,30) end make the ScalarEvolution engine return "CouldNotCompute" even for the outer loop (the inner loop is fine). You can find a screenshot of the translation of this loop here (with -view-cfg Polly version): http://i.imgur.com/Jyaqd.png The problem seems to be the fact that the ScalarEvolution can't consider the...
2018 Nov 27
2
ScalarEvolution class returns no valid loop exit count
Hi, I have problems to estimate the loop exit count of a simple loop with the ScalarEvolution class. simple loop: ...... int a = 0; for(int i; i < 10; ++i){ a = a + 1; }; ...... For the loop analyzation I use the ScalarEvolution class with the following initialization: ...... void analysis(Function* func) DominatorTree DT = DominatorTree(); DT.recalculate(*f...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...or a solution. Do you think it is a valid solution and I'm correct in my assumption? If so then I'll clean up the patch and attach a testcase for inclusion. Thanks! Marcello 2012/2/9 Nick Lewycky <nlewycky at google.com>: > Your patch should include a testcase, see test/Analysis/ScalarEvolution for > examples. "BranchInst* " should be "BranchInst *". You should have spaces > after the // in your comments. One of the comment lines isn't indented > properly. > > Nick > > On 8 February 2012 12:05, Marcello Maggioni <hayarms at gmail.com> wro...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
Mmm, sorry, the patch I posted crashes if ExitBr is null (which it may be ...) , this one should be ok (and passess all the ScalarEvolution tests in LLVM): diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index daf7742..b10fab2 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -4293,9 +4293,15 @@ ScalarEvolution::ComputeExitLimit(const Loop *L, BasicBlock *ExitingBl...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
Your patch should include a testcase, see test/Analysis/ScalarEvolution for examples. "BranchInst* " should be "BranchInst *". You should have spaces after the // in your comments. One of the comment lines isn't indented properly. Nick On 8 February 2012 12:05, Marcello Maggioni <hayarms at gmail.com> wrote: > Attached > > 2012...
2012 Feb 09
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...you gave in your email. It would really help to have a > testcase in .ll format. > > Nick > >> >> Thanks! >> >> Marcello >> >> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >> > for >> > examples. "BranchInst* " should be "BranchInst *". You should have >> > spaces >> > after the // in your comments. One of the comment lines isn't indented >> > properly. >> > >> > Nick >> >...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...ferent reason it would return the CNC than the one you gave in your email. It would really help to have a testcase in .ll format. Nick > Thanks! > > Marcello > > 2012/2/9 Nick Lewycky <nlewycky at google.com>: > > Your patch should include a testcase, see test/Analysis/ScalarEvolution > for > > examples. "BranchInst* " should be "BranchInst *". You should have spaces > > after the // in your comments. One of the comment lines isn't indented > > properly. > > > > Nick > > > > On 8 February 2012 12:05, Marcello M...
2012 Feb 09
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...p to have a >> testcase in .ll format. >> >> Nick >> >>> >>> Thanks! >>> >>> Marcello >>> >>> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >>> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >>> > for >>> > examples. "BranchInst* " should be "BranchInst *". You should have >>> > spaces >>> > after the // in your comments. One of the comment lines isn't indented >>> > properly. >>> > >>...
2016 Apr 23
2
[IndVarSimplify] Narrow IV's are not eliminated resulting in inefficient code
...h, as the loop now has a smaller instruction set and succeeds to unroll w/o any extra #pragma's. I also ran the LLVM tests against the patch. There are 6 new failures: Analysis/LoopAccessAnalysis/number-of-memchecks.ll Analysis/LoopAccessAnalysis/reverse-memcheck-bounds.ll Analysis/ScalarEvolution/flags-from-poison.ll Analysis/ScalarEvolution/nsw-offset-assume.ll Analysis/ScalarEvolution/nsw-offset.ll Analysis/ScalarEvolution/nsw.ll I haven't inspected these failures in detail yet, but it's likely the tests merely need to be adjusted to handle the new no-wrap flags the p...
2012 Feb 09
1
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...mat. >>> >>> Nick >>> >>>> >>>> Thanks! >>>> >>>> Marcello >>>> >>>> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >>>> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >>>> > for >>>> > examples. "BranchInst* " should be "BranchInst *". You should have >>>> > spaces >>>> > after the // in your comments. One of the comment lines isn't indented >>>> > properly. >&g...
2019 Sep 17
2
ScalarEvolution invariants around wrapping flags
...een SCEV and IndVarSimplify, which tacks an unwanted "nuw" onto an "add i32 %whatever, -1" (which actually almost certainly will overflow), leading ultimately to an infinite loop. A fuller description and test-case is at the end for anyone interested. The issue seems to be with ScalarEvolution's attempts to cache SCEV objects, which don't include wrapping flags in the immutable state. That means that once ScalarEvolution has created an expression as "nuw" it will be that way forever, even if analysed from an entirely separate part of the function where that's not ne...
2012 Aug 29
0
[LLVMdev] How to require ScalarEvolution analysis in a Module pass?
Guys, What I want to do is to hack global opt pass, which needs ScalarEvolution analysis. However opt crashed saying "opt: /home/xchen/llvm/include/llvm/PassAnalysisSupport.h:242: AnalysisType& llvm::Pass::getAnalysisID(const void*, llvm::Function&) [with AnalysisType = llvm::ScalarEvolution]: Assertion `ResultPass && "Unable to find requested analysi...
2017 Jul 24
2
LazyValueInfo vs ScalarEvolution
Hi, Both LazyValueInfo and ScalarEvolution can calculate a constant range for an LLVM Value. I found that some times they do not agree, may be I interpreted them incorrectly For example in the following IR: bb85: ; preds = %bb85, %bb73 %tmp86 = phi i32 [ 1, %bb73 ], [ %tmp95, %bb85 ] %tmp95...
2019 Sep 19
2
ScalarEvolution invariants around wrapping flags
> 1. Callers are expected to not engage in speculation. ScalarEvolution > itself must only create expressions it knows hold in all cases. This is correct. There is some more relevant text in ScalarEvolution::isSCEVExprNeverPoison. And you're right, this is quite restrictive. > Long term, I think that it would be cleaner to rework this so that all of the S...
2019 Oct 30
2
How to make ScalarEvolution recompute SCEV values?
...hey should be AddRecExpr. If I re-run the whole pass on the IR outputted by the first iteration, it will correctly identify them as AddRecExpr. I've already tried called Scalar Evolution’s *ForgetAllLoops* function, but that doesn't work. I also tried calling the *runOnFunction* from the ScalarEvolution pass, but that also didn't work. My question is: how can I make ScalarEvolution re-calculate the SCEV values for the unknown SCEVs, or, is there a way to re-run ScalarEvolution and LoopInfo analysis pass during my pass? This is my current CloneLoop function: Loop *cloneLoop(Function *F, Loo...
2008 Feb 22
2
[LLVMdev] ScalarEvolution Patch
Dear All, Is the following patch to ScalarEvolution correct? It seems that without it, the enclosing for loop could skip over SCEVAddRecExpr's in the Ops[] array. -- John T. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: scpatch URL: <http://lists.llvm.org/pipermail/llvm-dev/attachm...
2010 Aug 12
2
[LLVMdev] Questions about trip count
...propose to first check if the trip count is calculated correctly. I would do this with opt by calling: opt -mem2reg -loopsimplify -indvars -scalar-evolution -analyze prog.ll At the end of the output the tripcount of every loop should be written. To get the trip count in your pass you should ask ScalarEvolution. ScalarEvolution *SE; Loop *L; SE->getBackedgeTakenCount(L); If you need help trying this please ask back. Cheers Tobi