Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] run -mem2reg and -reg2mem programmably from within a Pass"
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
2010 Oct 20
0
[LLVMdev] Pass Incompatibility
On 10/20/10 6:05 AM, Luke Dalessandro wrote:
> I have a transformation where I'd like to use both DominatorTree (for ExtractCodeRegion), and DemoteRegisterToMemory (i.e., reg2mem). The transformation is phased, so all occurrences of getAnalysis<DominatorTree>(Function) happen before any occurrence of getAnalysisID<FunctionPass>(&DemoteRegisterToMemoryID, Function).
I
2010 Oct 20
5
[LLVMdev] Pass Incompatibility
I have a transformation where I'd like to use both DominatorTree (for ExtractCodeRegion), and DemoteRegisterToMemory (i.e., reg2mem). The transformation is phased, so all occurrences of getAnalysis<DominatorTree>(Function) happen before any occurrence of getAnalysisID<FunctionPass>(&DemoteRegisterToMemoryID, Function).
If I register these two passes with DominatorTree first, I
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 May 17
1
[LLVMdev] eliminate phi nodes, reduce unnecessary loads / stores , reg2mem, mem2reg
Hi,
I work on a pass that requires as input LLVM code without any phi nodes. For
this, I use the reg2mem pass which produces suitable code, the pass runs
correctly, but I obtain a significant performance decrease. I expect that this
is because there are more reads / writes to memory after running the reg2mem
pass.
How can I optimize the code, without inserting any phi nodes? Or is there a
2008 Jul 12
3
[LLVMdev] Little bug in LoopInfo after Rotate?
Hello, I have two for loops (one inside the other), that after indvars,
looprotate, etc. (the important here is the loop rotate), is similar to this
(I've stripped the real operations):
define i32 @f() nounwind {
entry:
br label %bb1
bb1: ; preds = %bb3, %bb1, %entry
%i.0.reg2mem.0.ph = phi i32 [ 0, %entry ], [ %i.0.reg2mem.0.ph, %bb1 ],
[ %indvar.next9, %bb3 ] ;
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
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 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
2007 Sep 05
2
[LLVMdev] reg2mem pass
Hello, guys.
I just tested -reg2mem pass to see how it changes my bitcode.
E.g., for the following simple C code:
-------------------------------------------------------------
int foo() {
int i,j;
int sum = 0;
for (i=0; i<10; i++)
{
sum += i;
for (j=0; j<3; j++)
sum += 2;
}
return sum;
}
-------------------------------------------------------------
I could get the
2015 Apr 22
2
[LLVMdev] Use clang to generate LLVM IR with -O3, how to visit these load operations after -reg2mem
Hi, all
I want to instrument load/store operations in LLVM IR. And I find the LLVM
IR generated with flag -o3 is much more efficient than -o0, so I try to
instrument on these optimized LLVM IR, but, some load operations are
changed to Phi loads. Then, I try the -reg2mem flag to remove these phi
nodes.
The problems are:
1) I use visitLoadInst to collect these load operations, and it seems I
2007 Aug 10
0
[LLVMdev] Reg2Mem pass
On Fri, 2007-08-10 at 00:51 -0500, Seung Jae Lee wrote:
> Hi, guys.
>
> I'm interested in using reg2mem pass but not sure about the concept of it.
> Can you let me know a reference about it, if any?
> Forgive my ignorance. -_-;
The reg2mem pass undoes SSA form. That is, it turns SSA registers into
alloca instructions with loads and stores.
>
> Thanks,
> Seung J.
2012 Dec 31
1
[LLVMdev] reg2mem breaks module
Hello,
I'm trying to apply the reg2mem pass on my bc file, but it somehow adds an instruction before a landingpad instruction and so I get a broken module error:
The unwind destination does not have a landingpad instruction!
%41 = invoke %class.x* @_ZN10xC2Ev(%class.x* %.reload19)
to label %.noexc unwind label %88
2007 Aug 10
2
[LLVMdev] Reg2Mem pass
Hi, guys.
I'm interested in using reg2mem pass but not sure about the concept of it.
Can you let me know a reference about it, if any?
Forgive my ignorance. -_-;
Thanks,
Seung J. Lee
2015 Apr 22
2
[LLVMdev] Use clang to generate LLVM IR with -O3, how to visit these load operations after -reg2mem
Best Regards!
Eric Lew
On 周三, 4月 22, 2015 at 12:11 下午, David Blaikie < dblaikie at gmail.com [dblaikie at gmail.com] > wrote:
On Tue, Apr 21, 2015 at 8:34 PM, Eric Lu <eirc.lew at gmail.com> wrote:
> Hi, all
>
> I want to instrument load/store operations in LLVM IR. And I find the LLVM
> IR generated with flag -o3 is much more efficient than -o0, so I try to
>
2013 Sep 22
0
[LLVMdev] Why total number of store instructions increased in case of gvn with reg2mem?
Might have to do with GVN's PRE (partial redundancy elimination), which tends to increase code size.
H.
----- Original Message -----
From: Abhinash Jain
Sent: 09/22/13 01:17 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Why total number of store instructions increased in case of gvn with reg2mem?
Below are the 4 cases out of which for the first 3 cases am able to understand the variation
2013 Sep 22
0
[LLVMdev] Why total number of store instructions increased in case of gvn with reg2mem?
Below are the 4 cases out of which for the first 3 cases am able to
understand the variation on total number of store inst.
But
when -gvn parameters is passed (in case 4) , why does the total number of
strore Instruction present on the attached file increases (instead of
decrease).
Please explain considering that use of -reg2mem pass is mandatory.
eg.
clang -emit-llvm bzip.c -c -o bzip1.bc
2010 Oct 11
3
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi,
I am working on a pass aimed to unify multiple exits of a loop into a unique
basic block. The approach is straight forward:
I create a unique BasicBlock BB_unique that has as predecessors all the exit
blocks of the loop, it contains a phi instruction and a switch to redirect
the flow correctly. Additionally, for each initial exit block I create an
associated block that will jump to the
2010 Apr 20
2
[LLVMdev] How to delete a instruction?
Hi,
when I delete some instruction, I got some error prompt message.
- %i.0.reg2mem.0 = phi i32 [ 0, %bb5 ], [ %indvar.next, %bb12 ] ; <i32>
[#uses=2]
- %s.0.reg2mem.0 = phi i32 [ 0, %bb5 ], [ %tmp16, %bb12 ] ; <i32> [#uses=1]
- %tmp14 = tail call i32 @foobar(i32 %i.0.reg2mem.0) nounwind ; <i32>
[#uses=1]
- %tmp16 = add i32 %tmp14, %s.0.reg2mem.0 ; <i32>
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