Displaying 20 results from an estimated 5000 matches similar to: "Function LICM for readonly, nocapture functions"
2012 Sep 09
1
[LLVMdev] isSafeToSpeculativelyExecute() for CallInst
Hi Nadav,
On 08/09/12 22:51, Nadav Rotem wrote:
>
> On Aug 19, 2012, at 2:55 PM, "Kuperstein, Michael M"
> <michael.m.kuperstein at intel.com <mailto:michael.m.kuperstein at intel.com>> wrote:
>
>> Hello,
>> Currently, llvm::isSafeToSpeculativelyExecute() always returns false for Call
>> instructions.
>> This has actual performance
2011 Feb 07
3
[LLVMdev] A question about LICM (Loop Invariant Code Motion)
Hi,
I recently looked into the LICM(Loop Invariant Code Motion) pass of
LLVM and got a question about hoist load instruction to loop
preheader. I would like to show two examples:
Example 1:
int func(int n, int *fp) {
int i;
int a[1000];
for (i = 0; i < n; ++i) {
a[i] += *fp; // load from *fp pointer, no hoist
}
}
Here, load *fp CAN NOT be hoisted to loop preheader. If replace *fp
2012 Sep 08
0
[LLVMdev] isSafeToSpeculativelyExecute() for CallInst
On Aug 19, 2012, at 2:55 PM, "Kuperstein, Michael M" <michael.m.kuperstein at intel.com> wrote:
> Hello,
>
> Currently, llvm::isSafeToSpeculativelyExecute() always returns false for Call instructions.
> This has actual performance implications, because loop-invariant code motion makes this check, and will never hoist instructions that are not safe to speculatively
2012 Aug 19
2
[LLVMdev] isSafeToSpeculativelyExecute() for CallInst
Hello,
Currently, llvm::isSafeToSpeculativelyExecute() always returns false for Call instructions.
This has actual performance implications, because loop-invariant code motion makes this check, and will never hoist instructions that are not safe to speculatively execute.
Unfortunately, there is currently no way to signal to LICM that a function is safe to speculatively execute. The
2010 Jan 11
0
[LLVMdev] LICM ilist question.
I am using LLVM 2.6 and I have a question on the use of the
BasicBlock::iterator to hoist loop invariant instructions to the loop
preheader. When I process the instructions backward as shown in the
following code, I got the following error right after the "hoist(I)" is
done. Can anyone advise whether I am misusing BasicBlock::iterator?
/opt/llvms/src/llvm_26/
2010 Jan 12
0
[LLVMdev] LICM ilist question.
Hi Gang-Ryung!
Your reverse iteration of instructions in the BB
> * for (BasicBlock::iterator II = BB->end(); II != BB->begin(); ) *{
>
> Instruction &I = *--II;
>
> if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) &&
> isSafeToExecuteUnconditionally(I))
> * hoist(I);*
>
2014 Dec 15
2
[LLVMdev] Modularizing LICM
Hi,
I'm writing a new loop pass, and has a need to call LICM(Loop Invariant Code Motion) 'PromoteAliasSet' on modified loop.
For now I didn't found any why to call 'PromoteAliasSet' from my pass explicitly.
The only way is to schedule LICM pass after my pass.
For some reason my pass need more control and preferring to call LICM 'PromoteAliasSet' instead running
2015 Feb 11
2
[LLVMdev] question about licm
hi,
I applied licm with basicaa on the following codes:
int j = atoi(argc[1]);
int lower[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
int upper[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
for(i = lower[j]; a[i] < 100 && i < upper[j]; i ++);
I notice that upper[j] is not hoisted out from the loop. Is this
because j could be larger than 10?
Thanks a lot!
Best,
2013 Nov 02
1
[LLVMdev] LICM and SCEV AA?
Sent from my iPhone
> On Nov 2, 2013, at 1:52 AM, Andrew Trick <atrick at apple.com> wrote:
>
>
>> On Oct 31, 2013, at 6:06 AM, Hal Finkel <hfinkel at anl.gov> wrote:
>>
>> Hello,
>>
>> We currently generate suboptimal code for this loop:
>>
>> for (int i = 1; i < LEN; i++) {
>> a[i] = a[0] + b[i];
>> }
>>
2009 Oct 27
2
[LLVMdev] LICM
Hi all,
I just noticed that LICM does not hoist/sink the following store out of
the loop:
int array[20];
int i;
for (i = 0; i<100; i++) {
array [0] = 0;
}
The getElementPtr instruction is hoisted out of the loop; the store is
not. Did I miss something obvious? Bitcode file attached.
Generated using LLVM 2.5 and
llvm-gcc -c -emit-llvm
2016 Apr 11
2
[LICM][MemorySSA] Converting LICM pass to use MemorySSA to avoid AliasSet collapse issue
Hi All,
I'm looking into converting LICM to use MemorySSA instead of AliasSets to
determine when it is safe to hoist/sink/promote loads and stores to get
around the issue of alias set collapse (see discussion [1]). I have a
prototype implementation, but have run into two issues that I could use
input from the designers of MemorySSA to resolve:
1) Is MemorySSA intended to be
2013 Nov 02
0
[LLVMdev] LICM and SCEV AA?
On Oct 31, 2013, at 6:06 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> Hello,
>
> We currently generate suboptimal code for this loop:
>
> for (int i = 1; i < LEN; i++) {
> a[i] = a[0] + b[i];
> }
>
> The largest problem is that we won't vectorize the loop because the loop vectorizer does not grok the independence of a[i] and a[0] (note that i starts at
2014 Dec 22
2
[LLVMdev] Modularizing LICM
One way you could go is to expose the interface in
include/llvm/Transforms/Utils/LoopUtils.h. There's a similar approach
in the LCSSA and LoopSimplify passes, both define functions used by
other passes (e.g LoopUnroll and LICM).
On Fri, Dec 19, 2014 at 10:58 PM, Philip Reames
<listmail at philipreames.com> wrote:
> I've come across similar use cases recently. In particular,
2015 Dec 01
2
LICM doesn't work for IntrReadMem intrinsic function
Hi, All,
Suppose I define one memory read only intrinsic function "foo" in
Intrinsics.td like this
def int_foo : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
[IntrReadMem]>;
Suppose I have the following IR, which means the intrinsic function "foo"
is called 10 times in a loop. Since the parameters of function "foo" are
invariant and the function
2013 Oct 31
3
[LLVMdev] LICM and SCEV AA?
Hello,
We currently generate suboptimal code for this loop:
for (int i = 1; i < LEN; i++) {
a[i] = a[0] + b[i];
}
The largest problem is that we won't vectorize the loop because the loop vectorizer does not grok the independence of a[i] and a[0] (note that i starts at 1 in this loop). While we can probably fix the vectorizer to handle this, I don't think that is the right place for
2006 Mar 16
2
[LLVMdev] Stupid '-load-vn -licm' question (LLVM 1.6)
Hello! I'm compiling code which uses pointers as iterators. For some
reason--probably a silly misunderstanding of the docs--I can't
eliminate duplicate pointer loads. I'll probably figure this out
eventually, but if somebody else sees the answer instantly, I
certainly won't complain. :-)
Here are the optimizers I'm running:
opt -f -simplifycfg -dce -instcombine
2010 Aug 15
2
[LLVMdev] a LICM bug (in LLVM-2.7)?
I am studying the Transform/Scalar/LICM.cpp pass, and wrote a simple
test program to validate.
void testLICM(void){
int i,N=100;
int data;
for(i=0;i<N;i++){
data = 1;
printf("i: %d\n",i);
}
printf("data: %d\n", data);
}
I expect the "data=1" will be moved out of loop (either hoist or sink).
However, to my surprise, that statement
2009 Oct 27
1
[LLVMdev] LICM
On Oct 27, 2009, at 9:26 AM, Nick Lewycky wrote:
> 2009/10/27 Marc Brünink <marc at bruenink.de>
> Hi all,
>
> I just noticed that LICM does not hoist/sink the following store out
> of the loop:
>
> int array[20];
> int i;
> for (i = 0; i<100; i++) {
> array [0] = 0;
> }
>
> The getElementPtr instruction
2010 Aug 15
0
[LLVMdev] a LICM bug (in LLVM-2.7)?
I don't think licm looks at loads/stores to allocas -- these are
usually handled by mem2reg which happens much earlier (if you run your
example with -mem2reg you'll see it already deleted the store). In
fact, licm sinks the stores by converting them to stores to allocas
first and running mem2reg on that.
If you change your example to
void testLICM(int* restrict p)
{
int i,N=100;
2011 Dec 14
2
[LLVMdev] Adding dependency on MemoryDependenceAnalysis pass to LICM causes opt to get stuck in addPass
I'm attempting to add some support for hoisting/sinking of memory-using
intrinsics in loops, and so I want to use MemoryDependenceAnalysis in
LICM, but when I modify getAnalysisUsge to include this :
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
AU.addRequired<DominatorTree>();
AU.addRequired<LoopInfo>();