search for: simplifyindvar

Displaying 15 results from an estimated 15 matches for "simplifyindvar".

2013 Jun 25
2
[LLVMdev] SimplifyIndVar looses nsw flags
Hello, I'm using LLVM to reason about memory safety of programs. One goal is to prove that certain array accesses are always safe. Currently, one of these proofs fails because of a missing no-signed-wrap (nsw) flag. I found that it has been "lost" during the SimplifyIndVar pass. Here's the example: int foo(int a[]) { int sum = 0; for (int i = 0; i < 1000; ++i) sum += a[i]; return sum; } // *** IR Dump Before Induction Variable Simplification *** // for.body: ; preds = %entry, %for.body // %i.05 =...
2013 Jun 25
0
[LLVMdev] SimplifyIndVar looses nsw flags
...; > I'm using LLVM to reason about memory safety of programs. One goal is > to prove that certain array accesses are always safe. > > Currently, one of these proofs fails because of a missing > no-signed-wrap (nsw) flag. I found that it has been "lost" during > the SimplifyIndVar pass. Here's the example: > > int foo(int a[]) { > int sum = 0; > for (int i = 0; i < 1000; ++i) > sum += a[i]; > return sum; > } > > // *** IR Dump Before Induction Variable Simplification *** > // for.body: ; preds = %entry, %for.body > // %i.05 = phi i32...
2017 Mar 29
2
sdiv in array subscript
On Wed, Mar 29, 2017 at 2:15 PM, Friedman, Eli <efriedma at codeaurora.org> wrote: > On 3/29/2017 1:05 PM, Hongbin Zheng wrote: > >> Hi Eli, >> >> Thanks. Do you mean ideally we should extend SimplifyIndVar to do the >> sdiv->udiv replacement? >> > > I haven't really looked into it closely, but it seems to make sense. Ok. Once I extend SimplifyIndVar, e.g. the simplifyUsersOfIV function. How I can add a regression test for the extension? simplifyUsersOfIV is not a pass. T...
2016 Oct 16
3
Induction variable identification?
Hi, How does LLVM identify induction variables of a loop? Is the algorithm based on SSA graphs? I have a complicated loop and I need to do some analysis around it. Can anyone please point me to source of identification part? -- *Disclaimer: Views, concerns, thoughts, questions, ideas expressed in this mail are of my own and my employer has no take in it. * Thank You. Madhur D. Amilkanthwar
2017 Mar 29
2
sdiv in array subscript
Hi Eli, Thanks. Do you mean ideally we should extend SimplifyIndVar to do the sdiv->udiv replacement? Thanks Hongbin On Wed, Mar 29, 2017 at 10:59 AM, Friedman, Eli <efriedma at codeaurora.org> wrote: > On 3/29/2017 10:35 AM, Hongbin Zheng via llvm-dev wrote: > >> Hi llvm-dev, >> >> Looks like currently ScalarEvolution will give...
2018 Feb 07
0
retpoline mitigation and 6.0
...*, llvm::SCEV const*) /home/dwmw2/git/llvm/lib/Analysis/ScalarEvolution.cpp:9110:0 #10 0x0000000002f3a1f8 llvm::ScalarEvolution::getSignExtendExpr(llvm::SCEV const*, llvm::Type*, unsigned int) /home/dwmw2/git/llvm/lib/Analysis/ScalarEvolution.cpp:1991:0 #11 0x0000000003dd8df8 (anonymous namespace)::SimplifyIndvar::strengthenOverflowingOperation(llvm::BinaryOperator*, llvm::Value*) /home/dwmw2/git/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp:652:0 #12 0x0000000003dd9578 (anonymous namespace)::SimplifyIndvar::simplifyUsers(llvm::PHINode*, llvm::IVVisitor*) /home/dwmw2/git/llvm/lib/Transforms/Utils/SimplifyInd...
2018 Feb 07
6
retpoline mitigation and 6.0
I've landed the patch in r324449. Before we merge this into two different Clang release branches and almost immediately release one of them, I would really like someone to confirm that this patch works well with the Linux kernel. David, if you're up for that, it would be great. Alternatively, Guenter or someone else here can help. On Tue, Feb 6, 2018 at 5:59 PM Chandler Carruth
2017 Jul 25
2
loop canonical variables
...le, wouldn't it? > > If you look into the imlplementation of > getCanonicalInductionVariable(), it just walks the IR instructions and > checks some conditions. You can have your own implementation that, > instead of returning the first matching PHI, return all matching PHIs. > SimplifyIndVar won't try to canonicalize, though. > > Michael > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
2017 Mar 29
2
sdiv in array subscript
Hi llvm-dev, Looks like currently ScalarEvolution will give up if there is a sdiv in array subscript, e.g. int i; A[i * 64 / 2] in this case ScalarEvolution will just return an unknown for (i * 64 / 2). For this case, InstCombine will do the jobs, but in general, is there a pass to deal with the sdiv here? like replace sdiv by udiv based on the range of "i"? Thanks Hongbin
2014 Dec 18
2
[LLVMdev] missing optimization for icmps in induction variables?
..."%civ.inc `slt` %len". Currently neither of these happen (i.e. even if I make transformation (1) manually, (2) does not kick in). Is the above reasoning correct? If it is, what is the right place to add this logic to? I'm thinking ScalarEvolution (so that this gets picked up by SimplifyIndVar), but maybe there is a more idiomatic place? The case above is a simplified form of my real workload, which involves smin and smax expressions; so the implementation has to be easily generalizable to such cases. Thanks, -- Sanjoy
2017 Jul 25
2
loop canonical variables
I call this function and it returns only "i" in my example. Are there any ways to return "j" also? 2017-07-25 19:11 GMT+02:00 Michael Kruse <llvmdev at meinersbur.de>: > There is Loop::getCanonicalInductionVariable() > > You may need to run the "-indvars" (IndVarSimplify) pass before it > returns a value. I am not sure it normalizes the step size
2012 Jun 05
0
[LLVMdev] How to unroll loops in opposite loop nest order
...w to process loops outside in still using the UnrollLoop function? I noticed another case of referencing LPM without a null check and fixed it here r158007. You'll should be careful to check everything that's currently disabled when LPM is missing: domtree update, ScalarEvolution update, SimplifyIndvar. If you need any of these things I suggest changing the interface. Maybe it would work to pass in FunctionPass instead of LPM. In the one place we actually need an LPM (deleteLoopFromQueue), we could check FunctionPass's type and cast. Maybe getAsPMDataManager()->getPassManagerType() == PMT...
2015 Jan 08
2
[LLVMdev] missing optimization for icmps in induction variables?
...ly neither of these happen (i.e. even if I make transformation >> (1) manually, (2) does not kick in). >> >> Is the above reasoning correct? If it is, what is the right place to >> add this logic to? I'm thinking ScalarEvolution (so that this gets >> picked up by SimplifyIndVar), but maybe there is a more idiomatic >> place? The case above is a simplified form of my real workload, which >> involves smin and smax expressions; so the implementation has to be >> easily generalizable to such cases. > > > Before reading your two steps I was going to...
2012 Jun 05
2
[LLVMdev] How to unroll loops in opposite loop nest order
I am trying to implement loop unrolling in a context, where lots of constant propagation has taken place. Unrolling an outer loop might make an inner loop have constant bounds, therefore I want to process the loops outside in, i.e. from parent loops to nested loops. Unfortunately the standard loop pass manager performs loop passes inside out, i.e. from nested loops to parent loops, thereby missing
2015 Jul 29
1
[LLVMdev] Error when i am using command make -j4 command in cygwin to compile safecode
...for Release+Asserts build llvm[3]: Compiling X86AsmPrinter.cpp for Release+Asserts build llvm[3]: Compiling SelectionDAG.cpp for Release+Asserts build llvm[2]: Compiling MemDerefPrinter.cpp for Release+Asserts build llvm[2]: Compiling MemoryBuiltins.cpp for Release+Asserts build llvm[3]: Compiling SimplifyIndVar.cpp for Release+Asserts build llvm[3]: Compiling X86CallFrameOptimization.cpp for Release+Asserts build llvm[3]: Compiling SimplifyInstructions.cpp for Release+Asserts build llvm[2]: Compiling MemoryDependenceAnalysis.cpp for Release+Asserts build llvm[3]: Compiling SimplifyLibCalls.cpp for Release...