Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] getSmallConstantTripCount problem"
2011 Apr 30
3
[LLVMdev] LoopInfo are not able to identify some natural loops?
In C code, if a loop is not a natural loop, that means its loop body should
at least have one label, right? In that case, some BB out of the loop can
jump to the loop body, so the loop has more than on entry.
Does LoopInfo guarantee to identify all natural loops? This property is very
important for my pass.
regards,
Bo
On Fri, Apr 29, 2011 at 11:50 PM, Cameron Zwarich <zwarich at
2012 May 21
1
[LLVMdev] No getSmallConstantTripCount function in current LLVM version
Hi,
I cannot find the getSmallConstantTripCount function in the current LLVM. Can anyone tell me whether there is still such a function to get the trip count in LLVM?
Thank you very much.
Best,
Han
2011 Apr 30
2
[LLVMdev] LoopInfo are not able to identify some natural loops?
Hi,
I found that some loops can not be identified by LoopInfo pass. For example,
the loop at line 3094 of rdopt.c of benchmark 464.h264ref from spec cpu2006
is not a loop or a child (pr grandchild) of any loop in the loop list
generated by LoopInfo pass. The documentation of LoopInfo says that it
identifies natural loops, who have exactly one entry point. But the IR of
this loops shows that
2012 Jan 18
2
[LLVMdev] getSmallConstantTripCount function doesn't work for obvious cases
Hi,
My pass heavily relies on llvm::Loop's getSmallConstantTripCount method.
However, I found that it doesn't work for some simple cases.
In the following example, I can get the constant trip count of the
outermost loop if statement "a[l] = a[l] + 1" is there. After commenting
out this line, the returned constant trip count for that loop is 0. In my
pass, I traverse the nested
2011 Apr 30
0
[LLVMdev] LoopInfo are not able to identify some natural loops?
A natural loop is one whose header dominates all of the nodes in the loop. There is probably some block outside of the loop jumping to a block in the loop body.
Cameron
On Apr 29, 2011, at 7:43 PM, Bo Wu <bwu at cs.wm.edu> wrote:
> Hi,
>
> I found that some loops can not be identified by LoopInfo pass. For example, the loop at line 3094 of rdopt.c of benchmark 464.h264ref from
2011 May 01
0
[LLVMdev] LoopInfo are not able to identify some natural loops?
On 4/30/11 8:52 AM, Bo Wu wrote:
> In C code, if a loop is not a natural loop, that means its loop body
> should at least have one label, right? In that case, some BB out of
> the loop can jump to the loop body, so the loop has more than on entry.
Off the top of my head, I would think you are right: a C label would
have to exist within the loop in order to have a jump from outside the
2008 May 09
0
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi All,
the attached patch performs the splitting in the proposed manner.
before applying the patch, please execute
svn cp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp
to make the patch apply and preserve proper history.
Transforms/Utils/UnrollLoop.cpp contains the unrollLoop function, which is now
used by the LoopUnroll pass. I've also moved the
2008 May 09
3
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hello Matthijs,
On May 9, 2008, at 3:47 AM, Matthijs Kooijman wrote:
> Hi All,
>
> the attached patch performs the splitting in the proposed manner.
> before applying the patch, please execute
> svn cp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/
> UnrollLoop.cpp
> to make the patch apply and preserve proper history.
>
> Transforms/Utils/UnrollLoop.cpp
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
I now understand that IndVarSimplify.cpp is capable of reproducing array
references when the pointer initialization from the array address is found
inside the immediately enclosing loop, such that in the following code:
int A[20000], B[100], Z;
int main()
{
int i, j, *a, *b;
for ( a = &A[0], i = 0; i != 200; i++ )
for ( b = &B[0], j = 0; j != 100; j++
2014 Jan 15
3
[LLVMdev] Loop unrolling a function
Hi all,
I'm attempting to perform loop unrolling on a single function using the C++
API. Maybe I missed something in the docs, but I cannot figure out a way to
do this. The function I'm working with is very simple, containing a single
for loop and not much else. I compiled the function to IR using clang with
no optimizations enabled.
My initial plan was to first run the IndVarSimplify
2008 May 07
8
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hello Matthijs,
Separating mechanism from policy is a good thing for the LoopUnroll
pass. Instead of moving the policy to a subclass though, I think it'd
be better to move the mechanism, the unrollLoop function, out to be a
standalone utility function, with the LoopInfo object passed in
explicitly. FoldBlockIntoPredecessor would also be good to make into
a standalone utility function, since
2011 May 21
4
[LLVMdev] getCanonicalInductionVariable
Hi
I have the followed code for which I am writing a loop pass.
int main() {
int i = 0;
for (i=0; i<20; i++) {
printf ("hello world %d\n", i);
}
return 0;
}
In the function runOnLoop, I have the following instruction
PHINode *indv = NULL;
indv = L->getCanonicalInductionVariable();
However, when I check indv is always set to NULL.
Since the code has a canonical
2014 Jan 15
2
[LLVMdev] Loop unrolling a function
The loop rotation pass does modify the function, which I'm guessing means
that a FunctionPassManager can be used to run LoopPasses (this is not
obvious to me after looking through the FunctionPassManager code).
Unfortunately none of the other passes I'm using (ScalarEvolution, LCSSA,
IndVarSimplify, and LoopUnroll) appear to have an effect.
I verified that the function can be loop
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
2008 Aug 19
1
[LLVMdev] LoopInfo
Some of the LoopInfo APIs are preceeded by this comment:
// Note that all of these methods can fail on general loops (ie, there may
not
// be a preheader, etc). For best success, the loop simplification and
// induction variable canonicalization pass should be used to normalize
loops
// for easy analysis. These methods assume canonical loops.
What Pass would that be? IndVarSimplify?
2013 Sep 27
0
[LLVMdev] Trip count and Loop Vectorizer
Hi Sriram,
Thanks for performing this analysis. The problem here, both for memcpy and the vectorizer, is that we can’t predict the size of “n”, even though the only use of ’n’ is for the loop bound for the alloca [4 x [8 x i32]]. If you change the unroll condition to TC >= 0 then you will disable loop unrolling for all loops because getSmallConstantTripCount returns an unsigned number. You
2010 Apr 21
2
[LLVMdev] determining the number of iteration of a loop
Hello
I'm wandring to know how many times a block is executed inside a loop ?
knowing that I can't use getSmallConstantTripCount() because the number is
unkown "for (i=0;i<N;i++) for example"
I'm using a Function pass
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
if (Loop *L = LI->getLoopFor(BB)) {
if (L->getHeader() ==
2013 Sep 27
2
[LLVMdev] Trip count and Loop Vectorizer
Hi,
I am trying to get a small loop to *not vectorize* for cases where it doesn't make sense. For instance, this loop:
void foo(int a[4][8], int n)
{
int b[4][8];
for(int i = 0; i < 4; i++) {
for(int j = 0; j < n; j++) {
a[i][j] = b[i][j];
}
}
}
* Has maximum of 8ints copy. LLVM tries to use Memcpy for the inner loop. It is not helpful to perform
2016 Sep 16
4
SCEV cannot compute the trip count of Simple loop
Hi Deepali,
SCEV reports the backedge taken count as "((-1 * (sext i32 (3 + %x) to
i64))<nsw> + ((sext i32 (3 + %x) to i64) smax (sext i32 (6 + %x) to
i64)))", so symbolically it does have an answer.
Ideally SCEV should be able to exploit <nsw> on (3 + %x) and (6 + %x)
to fold the expression above to "3", but due to some systemic issues
SCEV can't exploit
2010 Apr 06
2
[LLVMdev] Get the loop trip count variable
Thanks a lot for your guys' help!!!
I guess once I am able to get *V* (which probably is a pointer to a
Value object), then, I can instrument some code at the IR level to
dump V. As long as I maintain V at this pass stage, I should be able
to dump the loop trip count. This is true, isn't it?
Basically, what I am going to do is to add a function call before the
loop body, such as: