Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] eliminate phi nodes, reduce unnecessary loads / stores , reg2mem, mem2reg"
2011 Aug 03
2
[LLVMdev] scalar evolution to determine access functions in arays
Hello Tobi,
You are right, we need to run some other passes before running the scalar evolution pass. The sequence that I run for this example is -O3 -loop-simplify -reg2mem. This is why I did not obtain the expressions depending on the loop indices. So I removed the reg2mem pass and scalar evolution computes the correct functions.
However, I need to run the reg2mem pass (or any other that
2011 Aug 03
0
[LLVMdev] scalar evolution to determine access functions in arays
On 08/03/2011 08:35 AM, Jimborean Alexandra wrote:
> Hello Tobi,
>
> You are right, we need to run some other passes before running the
> scalar evolution pass. The sequence that I run for this example is -O3
> -loop-simplify -reg2mem. This is why I did not obtain the expressions
> depending on the loop indices. So I removed the reg2mem pass and scalar
> evolution computes the
2011 Jul 27
3
[LLVMdev] scalar evolution to determine access functions in arays
Hello,
How can I compute the functions on the loop iterators used as array indices?
For example:
for i = 0, N
for j = 0, M
A[2*i + j - 10] = ...
Can I obtain that this instruction A[2*i + j - 10]= .. always accesses memory using a function f(i,j) = 2*i + j - 10 + base_address_of_A
If I run the scalar evolution pass on this code I obtain:
%arrayidx =
2011 Aug 03
0
[LLVMdev] scalar evolution to determine access functions in arays
On 07/27/2011 03:11 PM, Jimborean Alexandra wrote:
> Hello,
>
> How can I compute the functions on the loop iterators used as array
> indices?
>
> For example:
>
> for i = 0, N
> for j = 0, M
> A[2*i + j - 10] = ...
>
> Can I obtain that this instruction A[2*i + j - 10]= .. always accesses
> memory using a function f(i,j) = 2*i + j - 10 + base_address_of_A
2011 Jun 20
2
[LLVMdev] run -mem2reg and -reg2mem programmably from within a Pass
I am currently building a BasicBlock pass which requires to run -reg2mem
before it, and need to run -mem2reg after it to clean up.
So, I want to specify -reg2mem as one of the pre-requisite passes to it, as:
class MyPass: public BasicBlockPass{
virtual void getAnalysisUsage(AnalysisUsage &AU){
...
AU.addRequired<RegToMem>();
...
}
};
I searched all passes under
2011 Jun 20
0
[LLVMdev] run -mem2reg and -reg2mem programmably from within a Pass
I guess AU.addRequiredID(DemoteRegisterToMemoryID) would do the trick.
- xi
On Jun 19, 2011, at 11:03 PM, Chuck Zhao wrote:
> I am currently building a BasicBlock pass which requires to run -reg2mem before it, and need to run -mem2reg after it to clean up.
>
> So, I want to specify -reg2mem as one of the pre-requisite passes to it, as:
>
>
> class MyPass: public
2011 Aug 03
2
[LLVMdev] scalar evolution to determine access functions in arays
Only because in my next passes I change the CFG significantly and it is very hard to maintain the values of the Phi nodes.
Alexandra
________________________________
From: Tobias Grosser <tobias at grosser.es>
To: Jimborean Alexandra <xinfinity_a at yahoo.com>
Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu>; "luismastrangelo at gmail.com"
2011 May 30
1
[LLVMdev] Reg2mem: Identifying introduced memory locations (also, what happens to the phi nodes)
Hi.
Im exploring `opt -reg2mem` output for a simple C program (actually,
that is this snippet:
http://rosettacode.org/wiki/Dining_philosophers#C - compiled with
clang -O1) and got two questions regarding this pass.
1. How would I tell which memory locations were introduced by the
pass, and which memory locations were present in the original program?
After a brief diffing of .ll files, I'd
2012 Aug 20
2
[LLVMdev] How to eliminate PHI nodes on pointer types?
Somewhere during optimization PHI nodes on pointer types (including
alloca instructions) are being introduced, and they persist through the
scalar replacement of aggregates pass and others. I can't seem to find
a combination of passes or transformations to get rid of them. Has
anyone had this problem before, and know a transformation to eliminate
it? My optimization passes rely on
2011 Jul 25
1
[LLVMdev] print the memory address computed by getelementptr
Hi again,
Thank you, your suggestion worked well. I was looking for a pointer to void actually. But it seems that I do not get the memory address when passing the value of the GEP instruction.
For instance, when I print the address accessed by the second operandof the store instruction
store %struct.linked* %tmp23.reload8, %struct.linked** %curr.037.reg2mem
I obtain a memory address of the
2008 May 23
0
[LLVMdev] mem2reg & reg2mem
I have a register allocation bug I'm trying to track down. It's caused by a
convoluted series of events that results in a massive amount of code,
so looking at asm diffs is rather unhelpful.
I came up with the bright idea of adding a MaxPromotes flag to limit
the number of candidates that mem2reg promotes. But I couldn't
figure out how to safely promote some candidates but not
2011 Jul 20
3
[LLVMdev] print the memory address computed by getelementptr
Hi,
I want to print the memory locations computed by getelementptr. As I understood,
getelementptr does not access the memory, but it contains the address it
computes. I want to print these addresses at runtime (or process them). So, I
try to build a function that takes as argument a pointer and prints its value.
And to call this function, by sending the gep instruction as a parameter.
2011 Mar 12
0
[LLVMdev] problems when the llvm::ExtractCodeRegion updates the Phi nodes in successors ... is there a method to eliminate phi nodes ?
Hi,
I use the llvm::ExtractCodeRegion to extract each loop into a separate function,
but I have a problem when I run this on the SPEC CPU 2006 on the 401.bzip2
benchmark. First I use clang -O3 to generate optimized llvm code and then I
extract some loops from the module built from blocksort.c source file.
The problem is that the PHI nodes contained in the successors of the codeRepl
2011 Jul 20
0
[LLVMdev] print the memory address computed by getelementptr
On 7/20/11 10:02 AM, Jimborean Alexandra wrote:
> Hi,
>
> I want to print the memory locations computed by getelementptr. As I
> understood, getelementptr does not access the memory, but it contains
> the address it computes. I want to print these addresses at runtime
> (or process them). So, I try to build a function that takes as
> argument a pointer and prints its
2010 Oct 12
1
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi, I tried adding the PHI nodes in BB_unique, and it works for the simple
case described here, but in case the nodes were declared in some
predecessors of ExitBB1 and used in ExitBB1_redirect and its successors, it
won't work, unless I create entries for all of them in BB_unique.
B1 (declares PHI_1) B3
| |
B2
2011 Aug 31
2
[LLVMdev] Getting rid of phi instructions?
On 31.8.2011, at 11.41, Eli Friedman wrote:
> Mmm... reg2mem will transform IR with PHI's into IR without them, but
> it generates a bunch of alloca's, which I would assume are not cheap
> to lower to VHDL. You might have to write your own pass to get the
> precise transformation you're looking for.
Right. Thanks. I need to see the reg2mem source code.
Teemu
2011 Aug 31
0
[LLVMdev] Getting rid of phi instructions?
On Wed, Aug 31, 2011 at 2:35 AM, Teemu Rinta-aho
<teemu.rinta-aho at nomadiclab.com> wrote:
> On 31.8.2011, at 11.41, Eli Friedman wrote:
>
>> Mmm... reg2mem will transform IR with PHI's into IR without them, but
>> it generates a bunch of alloca's, which I would assume are not cheap
>> to lower to VHDL. You might have to write your own pass to get the
2012 Jul 25
1
[LLVMdev] Inneffiecient code produced by reg2mem?
Is there a pass I can use after reg2mem to get rid of occurances like this?:
store i32 %cond, i32* %cond.reg2mem
%cond.reload = load i32* %cond.reg2mem
store i32 %cond.reload, i32* %cond4.reg2mem
Essentially, in this case, reg2mem creates an extra memory space to store
and load a value from just here, and never uses the value again; since this
isn't efficient code, I'm wondering if
2012 Aug 20
0
[LLVMdev] How to eliminate PHI nodes on pointer types?
Hi Andrew,
> Somewhere during optimization PHI nodes on pointer types (including
> alloca instructions) are being introduced, and they persist through the
> scalar replacement of aggregates pass and others. I can't seem to find
> a combination of passes or transformations to get rid of them. Has
> anyone had this problem before, and know a transformation to eliminate
> it?
2013 Apr 10
2
[LLVMdev] How to call the llvm.prefetch intrinsic ?
Hello,
Can anyone please guide me how can I replace a load instruction with a prefetch. I was looking at the intrinsic creation methods of the IRBuilder, but I can only find functions corresponding to memset, memcpy and memmove intrinsics, not for prefetching.
Also, I target x86-64 architectures. Is it sufficient to insert a call to the intrinsic in the LLVM IR to have the corresponding prefetch