search for: alloca

Displaying 20 results from an estimated 3310 matches for "alloca".

Did you mean: alloc
2012 Jul 31
3
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
..., i8*, i32, [4 x i8] } %struct.__st_parameter_common = type { i32, i32, i8*, i32, i32, i8*, i32* } @.cst = linker_private constant [11 x i8] c"matmul.f90\00", align 8 define internal void @init_array.1535(%struct.FRAME.matmul* nest %CHAIN.41) nounwind uwtable { entry: %CHAIN.41_addr = alloca %struct.FRAME.matmul*, align 8 %i = alloca i32 %j = alloca i32 %D.1539 = alloca i32 %D.1553 = alloca i32 %D.1542 = alloca i32 %D.1552 = alloca i32 %D.1554 = alloca i32 %D.1568 = alloca i32 %D.1557 = alloca i32 %D.1567 = alloca i32 %"alloca point" = bitcast i32 0 to i...
2013 Jul 25
4
[LLVMdev] Proposing a new 'alloca' parameter attribute to implement the Microsoft C++ ABI
...d, C++ methods are typically callee cleanup (thiscall), but free functions are caller cleanup (cdecl). Features -------- A few weeks ago, I sat down with some folks at Google and we came up with this proposal, which tries to add the minimum set of LLVM IL features to make this possible. 1. Allow alloca instructions to use llvm.stacksave values to indicate scoping. This creates an SSA dependence between the alloca instruction and the stackrestore instruction that prevents optimizers from accidentally reordering them in ways that don't verify. llvm.stacksave in this case is taking on a role s...
2004 Jul 20
1
[LLVMdev] /usr/local/src/llvm/include/Config/alloca.h:42:17: #error "The function alloca()
Hi As shown below, the .\configure script found a version of alloca(): --------------------- configure:20831: checking for working alloca.h configure:20853: gcc -o conftest -g -O2 conftest.c -ldl >&5 configure:20856: $? = 0 configure:20859: test -s conftest configure:20862: $? = 0 configure:20873: result: yes configure:20883: checking for alloca configure...
2011 Jul 25
0
[LLVMdev] Stack implementation
Piotr Kaleta <piotrek.kaleta at gmail.com> writes: > I'm translating the source of stack-based virtual machine into LLVM IR and > my plan is to implement the stack in LLVM IR (using alloca/load/store) in > order to emulate the VM's stack and then use the optimization phase > "mem2reg". Therefore I'm going to have a stack pointer that points to the > top of my stack. I'm curious whether I will have to implement that in a > linked-list fashion, i.e. ea...
2013 Jan 25
2
[LLVMdev] llvm alloca dependencies
...ins to find instructions that define the registers used in > the load. Can you tell me please what class/methods/existing path are good for > this? I assume that I must have a method with arguments like the variable used > into a Load instruction and a "stop instruction", like an Alloca. > > However, if I have something like : > > I1 : %a = alloca i32, align 4 > .... > I2 : %5 = load i32* %a, align 4 > I3 : %b = add i32 %a, %c > .... > I4 : %8 = load i32* %b, align 4 > > I4 is dependent on I1 since %8 is obtained using %a (indirectly) if t...
2011 Jul 25
2
[LLVMdev] Stack implementation
I'm translating the source of stack-based virtual machine into LLVM IR and my plan is to implement the stack in LLVM IR (using alloca/load/store) in order to emulate the VM's stack and then use the optimization phase "mem2reg". Therefore I'm going to have a stack pointer that points to the top of my stack. I'm curious whether I will have to implement that in a linked-list fashion, i.e. each stack node 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 >> b...
2013 Jan 25
0
[LLVMdev] llvm alloca dependencies
...optimizations (because maybe I have to look to memory accesses in the future). Maybe some of these optimizations I can enable when I am running my pass with opt ? It is still one thing that I don't understand. If the memory accesses will be eliminated, and I have the following situation: %i = alloca i32, align 4 %j = alloca i32, align 4 ..... %2 = load i32* %i, align 4 %3 = load i32* %j, align 4 %add = add nsw i32 %2, %3 %cmp2 = icmp sgt i32 %add, 2 How can I check that %cmp2 is dependent on both allocas? Sorry if the question was asked without any testing with optimizations enabled. Basica...
2012 Jul 31
0
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
...st_parameter_common = type { i32, i32, i8*, i32, i32, i8*, i32* } > > @.cst = linker_private constant [11 x i8] c"matmul.f90\00", align 8 > > define internal void @init_array.1535(%struct.FRAME.matmul* nest > %CHAIN.41) nounwind uwtable { > entry: > %CHAIN.41_addr = alloca %struct.FRAME.matmul*, align 8 > %i = alloca i32 > %j = alloca i32 > %D.1539 = alloca i32 > %D.1553 = alloca i32 > %D.1542 = alloca i32 > %D.1552 = alloca i32 > %D.1554 = alloca i32 > %D.1568 = alloca i32 > %D.1557 = alloca i32 > %D.1567 = alloca i3...
2015 Apr 05
2
[LLVMdev] alloca not in first bb behaving differently
It's not great IR, but it doesn't look like it should actually crash, just (without SROA) produce comparatively bad code. The alloca is only referenced in the basic block that it exists. If this isn't expected to work, then we should probably improve the documentation of alloca in the language reference. David > On 5 Apr 2015, at 04:55, Eric Christopher <echristo at gmail.com> wrote: > > Allocas not in the...
2013 Jul 30
0
[LLVMdev] Proposing a new 'alloca' parameter attribute to implement the Microsoft C++ ABI
How do you handle this during codegen? One problem is avoid stack changes (like spills). Another is coordinating things that are using allocas and those that are not but end up in the stack. Consider void foo(int arg1, int arg2, int arg3, ....CXXTypeWithCopyConstructor argn, int argp1...) You will need an alloca for argn, but the ABI also requires it to be next to the plain integers that didn' fit in registers, no? This is part of...
2005 May 23
2
alloca() on FreeBSD (PR#7890)
Full_Name: Eric van Gyzen Version: 2.1.0 OS: FreeBSD 5.4 Submission from: (NULL) (152.3.22.33) R-2.1.0 fails to compile on the newest release of FreeBSD, complaining about undefined references to __builtin_alloca. On FreeBSD, alloca() is declared in stdlib.h, not alloca.h as the R sources expect. Therefore, HAVE_DECL_ALLOCA does not get set, so the R sources declare alloca() after it has already been #defined by stdlib.h. A possible fix is to modify the configure script to look for the declaration of all...
2016 Dec 28
1
llvm pass
I want to insert new alloca Instruction after existing alloca Instruction in llvm pass so what attribute to be passed at last in following newallocaI = new AllocaInst(llvm::Type::getInt32PtrTy(context,0), //type 0, // ArraySize 8,...
2003 Jun 16
2
[LLVMdev] CWriter outputs non-portable use of alloca.h
On Mon, 2003-06-16 at 17:33, John Criswell wrote: > What would be better yet is to modify the code so that it does not use > alloca() at all. There seems to be little reason to use it aside from > convenience (but perhaps I have missed something). I think the idea is that alloca can give (probably significant) performance gains when used properly. In the cases where you need dynamic memory for some task but it doesn...
2013 Feb 26
2
[LLVMdev] mem2reg for non entry blocks?
...6, 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 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...
2016 Sep 27
2
SelectionDAG::LegalizeTypes is very slow in 3.1 version
In 3.1, the backend is very slow to legalize types. Following is the code snippet which may be the culprit: %Result.i.i.i97 = alloca i33, align 8 %Result.i.i.i96= alloca i33, align 8 %Result.i.i.i95 = alloca i33, align 8 %Result.i.i.i94 = alloca i33, align 8 %Result.i.i.i93 = alloca i33, align 8 %Result.i.i.i92= alloca i33, align 8 %Result.i.i.i91 = alloca i33, align 8 %Result.i.i.i90 = alloca i33, align 8 %Resul...
2009 Oct 12
3
[LLVMdev] Alloca Requirements
Are there any implicit assumptions about where alloca instructions can appear. I've got a failing test where the only difference between a passing test and a failing test is one application of this code in instcombine: // Convert: malloc Ty, C - where C is a constant != 1 into: malloc [C x Ty], 1 Seems pretty harmless to me. Later on the inst...
2008 Sep 17
3
[LLVMdev] variable size alloca
To what do variable size LLVM alloca instructions get translated, when they are turned into machine code? I compiled a piece of code to bitcode and disassembled it. The disassembled code showed that there were alloca instructions with variable-sized parameters within the bitcode. When I turned the bitcode into machine code, I p...
2013 Jan 24
2
[LLVMdev] llvm alloca dependencies
> I tried methods related to point 1) suggested by you, > but I still have problems of finding dependencies. > What exactly I want to do: > > I have a chain like : Alloca -> Load(1) -> ... -> Computation > where the variable might be changed -> Store(new_var) -> ... -> Load(n) Your example is not very clear. I don't understand what's involved in the "chain". > Computation where the variable is changed = means that : > I...
2013 Nov 27
2
non-standard alloca.h
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 AFAIK, alloca.h is not POSIX. Here's a patch that includes alloca.h only when it's really there. It also includes malloc.h, which is where mingw-w64 defines the alloca() macro, mapping it to gcc __builtin_alloca() or to msvcrt _alloca(). - -- O< ascii ribbon - stop html email! - www.asciiribbon.org...