Displaying 3 results from an estimated 3 matches for "origstep".
Did you mean:
ordistep
2011 May 07
1
[LLVMdev] Loop transformations using LLVM
...general approach to IV analysis is ScalarEvolution. You can query the expression for a loop header phi using ScalarEvolution::getSCEV. If it returns SCEVAddRecExpr with getLoop() == ThisLoop, then you've found an IV. You can build a new IV by replacing the "step" with SCEVAddExpr(1 + OrigStep). To materialize it in IR, you need to use a SCEVExpander. ...probably more complicated than you need.
-Andy
>
>
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Malveeka Tewari
> Sent: Thursday, May 05, 2011 14:51
> To: llvmdev at cs.u...
2011 May 05
0
[LLVMdev] Loop transformations using LLVM
Malveeka,
You can use the LoopInfo analysis to find the induction variable.
http://llvm.org/docs/doxygen/html/classllvm_1_1Loop.html#a72bbf45d2e00971f56bf8cfe4e1df01c
Cheers,
Nadav
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Malveeka Tewari
Sent: Thursday, May 05, 2011 14:51
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Loop transformations
2011 May 05
2
[LLVMdev] Loop transformations using LLVM
Hi
I am trying to write up a transformation for the following code where
instead of incrementing the loop variable by 1, I increment it by 2 ie.
for (i=0; i < THRES; *i++*) {
//do something
}
gets transformed to
for (i=0; i < THRES; *i+=2*) {
//do something
}
I am thinking of transforming the llvm bit-code in the following way.
Iterate over the function for the original code till I