Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] mem2reg"
2012 Mar 09
1
[LLVMdev] Scalar replacement of arrays
Nicolas Capens wrote:
> [...]
> I'm not sure if that's going to help achieve optimal code
> for when the array is sometimes being dynamically indexed.
> Essentially there should be some kind of store to load copy
> propagation. As far as I know that's exactly what mem2reg
> does, except that it only considers scalars and not elements
> of arrays.
>
> So would
2013 Feb 26
1
[LLVMdev] mem2reg for non entry blocks?
On 2/26/13 8:06 AM, Duncan Sands wrote:
> Hi Justin,
>
>> an alloca outside of the entry block might be inside a loop, in
>> which case the
>> semantics are that it would allocate more stack space on every
>> loop iteration.
>> I think some of the optimizers that run later try to move allocas
>> into the entry
>> block if possible,
2013 Feb 26
0
[LLVMdev] mem2reg for non entry blocks?
Hi Justin,
> an alloca outside of the entry block might be inside a loop, in which case the
> semantics are that it would allocate more stack space on every loop iteration.
> I think some of the optimizers that run later try to move allocas into the entry
> block if possible, but in general it is simpler to have the front-end just put
> them there in the first
2013 Feb 26
2
[LLVMdev] mem2reg for non entry blocks?
On Tue, Feb 26, 2013 at 5:42 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Vinod,
>
>
> On 23/02/13 02:20, Vinod Grover wrote:
>
>> Sorry if this has been discussed before, but I would appreciate any
>> pointers.
>> I am trying to understand why mem2reg only looks at allocas in entry
>> blocks, and
>> not for any allocas in a function. One
2009 Oct 01
3
[LLVMdev] PHI and Allocas
Hi,
I'm incrementing my toy compiler to account for variable mutations
around if/else blocks.
Reading the Kaleidoscope tutorial, I've learnt that I can substitute
the PHI node creation by allocas and retrieving the value later, if
needed. The Kaleidoscope example seems to account for one value only,
the result of:
Value *ThenV = Then->Codegen();
(...)
Value *ElseV =
2017 May 25
3
UD and DU chains for LLVM IR before running mem2reg
Hi,
Just had a simple question ,
The use-def and def-use chains provided by llvm::Value class ,
would they work for IR that has not been optimized by the "mem2reg" pass ?
( ie, IR code that contains memory interactions and is not in SSA form yet )
Thanks,
Malhar
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2015 Jul 17
2
[LLVMdev] Suspicious behavior of mem2reg (promoteSingleBlockAlloca)
Hi LLVMDev,
this is Jeehoon Kang, a Ph.D. student of Software Foundations Laboratory (
http://sf.snu.ac.kr), Dept. of Computer Science & Engineering, Seoul
National University. Our group studied the mem2reg pass, and we got a
question on its algorithm.
As far as I understand, the mem2reg pass essentially uses the SSA
construction algorithm to promote allocas into registers, but there are
2013 Feb 23
2
[LLVMdev] mem2reg for non entry blocks?
Sorry if this has been discussed before, but I would appreciate any
pointers.
I am trying to understand why mem2reg only looks at allocas in entry
blocks, and not for any allocas in a function. One case where allocas could
be used to build local data structures like linked list (and so on make it
unsafe), and for that the existing conditions in IsAllocaPromotable (i.e.
the alloca pointer cannot
2008 Jul 02
2
[LLVMdev] Problem while using mem2reg Optimization
Hi,
I am using various LLVM optimization passes and I noticed a strange
behaviour in Mem2Reg Optimization. These pass is used for SSA construction
and basically removed alloca of the corresponding pointers are just used in
load/stores.
I tried the following .ll file
*define i32 @test(i32 %y,i32 %z) {
entry:
%X = alloca i32 ; type of %X is i32*.
%X.0 = add i32 %y ,%z
2013 Feb 26
0
[LLVMdev] mem2reg for non entry blocks?
Hi Vinod,
On 23/02/13 02:20, Vinod Grover wrote:
> Sorry if this has been discussed before, but I would appreciate any pointers.
> I am trying to understand why mem2reg only looks at allocas in entry blocks, and
> not for any allocas in a function. One case where allocas could be used to build
> local data structures like linked list (and so on make it unsafe), and for that
> the
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;
2008 Jul 02
0
[LLVMdev] Problem while using mem2reg Optimization
On Wed, Jul 2, 2008 at 10:07 AM, kapil anand <kapilanand2 at gmail.com> wrote:
> Hi,
>
> I am using various LLVM optimization passes and I noticed a strange
> behaviour in Mem2Reg Optimization. These pass is used for SSA construction
> and basically removed alloca of the corresponding pointers are just used in
> load/stores.
> So, is there any restriction that all the
2009 Jan 28
4
[LLVMdev] Copy Instructions?
On Tuesday 27 January 2009 18:28, Eli Friedman wrote:
> You can use a no-op bitcast for scalars, but there isn't any reliable
> way to do it for all first-class values.
Guh.
> That said, I don't quite follow the issue. This is SSA, so the only way a
> value can change is if you change the code.
This isn't (yet) SSA. This is mem2reg turning things into SSA.
>
2009 Feb 19
0
[LLVMdev] Improving performance with optimization passes
Hi Jon,
On 2009-02-19, at 14:00, Jon Harrop wrote:
> I'm toying with benchmarks on my HLVM and am unable to get any
> performance improvement from optimization passes. I simply copied
> the use of PassManager from the Kaleidoscope tutorial:
>
> Any idea what I might be doing wrong? Has anyone else got this
> functionality giving performance boosts from OCaml?
2009 Jan 28
0
[LLVMdev] Copy Instructions?
On Jan 28, 2009, at 9:06 AM, David Greene wrote:
> On Tuesday 27 January 2009 18:28, Eli Friedman wrote:
>
>> You can use a no-op bitcast for scalars, but there isn't any reliable
>> way to do it for all first-class values.
>
> Guh.
>
>> That said, I don't quite follow the issue. This is SSA, so the
>> only way a
>> value can change is if
2020 May 12
4
bug report on mem2reg
Hi, all,
I think I found a bug on mem2reg in a particular case.
When I ran opt -mem2reg -basicaa -scalar-evolution -loops -da -analyze opts.ll, it collapsed. While without mem2reg option, it runs well. so I guess it has something to do with mem2reg.
The relative files have been affixed, please check them for me.
Thanks in advance.
liubaosen at tsinghua.edu.cn
-------------- next part
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
2017 Sep 07
5
RFC: Unify debug and optimized variable locations with llvm.dbg.addr [was: DW_OP_LLVM_memory]
I chatted with Chandler in person and came up with what I think is a much
simpler design than my previous design in the thread titled "RFC: Introduce
DW_OP_LLVM_memory to describe variables in memory with dbg.value".
The crux of the problem in that thread is that we need a representation,
particularly in the middle-end, to describe a variables address, at a
particular program point.
2016 Dec 09
10
RFC: Adding argument allocas
Clang is currently missing some low-hanging performance and code size
opportunities when receiving function parameters. For most scalar
parameters, Clang typically emits an alloca and stores the LLVM SSA
argument value into the alloca to initialize it. With optimizations, this
initialization is often removed, but it stays behind in debug builds and
when the user takes the address of a parameter (
2012 Mar 07
2
[LLVMdev] Scalar replacement of arrays
Hi all,
I'm implementing a virtual processor which features dynamic register
indexing, and I'm struggling to make LLVM 3.0 produce good code for it.
The register set is implemented as an LLVM array so it can be
dynamically indexed using GEP. However, most of the time the virtual
processor's registers are just statically indexed, and so I
expected/hoped the code would be as