search for: insertvalues

Displaying 20 results from an estimated 141 matches for "insertvalues".

Did you mean: insertvalue
2016 Feb 10
4
Memory Store/Load Optimization Issue (Emulating stack)
Thank you for the hint. I adjusted the code and it works: The code after replacing inttoptr with getelementptr: define { i32, i32, i8* } @test(i32 %foo, i32 %bar, i8* %sp) { entry: ; push foo (On "stack") %sp_1 = getelementptr i8, i8* %sp, i32 -4 %sp_1_ptr = bitcast i8* %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align 4 ; push bar %sp_2 = getelementptr i8, i8* %sp_1,
2016 Feb 08
2
Memory Store/Load Optimization Issue (Emulating stack)
Hello, I am trying to emulate the "stack" as like on x86 when using push/pop so afterwards I can use LLVM's optimizer passes to simplify (reduce junk) the code. The LLVM IR code: define { i32, i32, i32 } @test(i32 %foo, i32 %bar, i32 %sp) { ; push foo (On "stack") %sp_1 = sub i32 %sp, 4 %sp_1_ptr = inttoptr i32 %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align
2017 Jan 02
2
Indices for extractvalue and insertvalue
Hi Can someone explain to me why we cant use uint64_t for extractvalue and insertvalue indices, while GEP on arrays can have indices of any integer type. Basically if I load an array with UINT_MAX+O (O>=2) elements, I can not extract its last element. Given this restriction I feel we have a bug here (uint64_t is passed as a unsigned). This cant happen because of the if (NumElements > 1024)
2012 Dec 30
2
[LLVMdev] alignment issue, getting corrupt double values
I'm having an issue where a certain set of types and insert/extractvalue are producing the incorrect values. It appears as though extractvalue getting my sub-structure is not getting the correct data. I have these types: %outer = type { i32, %inner, i1 } %inner = type { double, i32 } The trouble is that when I have a value of type %outer then proceed to extract the components of the
2010 Jan 08
2
[LLVMdev] First-class aggregate semantics
On 01/07/2010 06:03 PM, Alastair Lynn wrote: > > You'll probably need to use insertvalue to construct your return value. Ah ha! The fact is I didn't really understand the significance of this part when I read it, and so didn't remember it when I needed it. OK, so I have tested it and I can now build up a struct like this %s1 = insertvalue {i32, i32} {i32 0, i32 0}, i32
2016 Feb 10
2
Memory Store/Load Optimization Issue (Emulating stack)
Thanks for the answers. Although I am not sure if I've understood the docs about how inttoptr/ptrtointr are different when compared to gep. It says: "It’s invalid to take a GEP from one object, address into a different separately allocated object, and dereference it.". To go back to my intention why I am doing this, I would like to "emulate" some x86 instructions with
2013 Mar 30
2
[LLVMdev] Missed optimisation opportunities?
I'm writing a front end for an existing interpreted language with slightly odd semantics for primitive values. Similar to the values in a database table, any value could be null, even for non-pointer types. For example a boolean variable could be true, false, or null. To model this behaviour, I'm passing an {i1, [type]} around for every numeric type. And using insertvalue / extractvalue
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
Hi again, So I finally gave up on trying to get through the converting (x86' push pop mov add) because it deals a lot with crazy pointer arithmetics and sonce inttoptr and ptrtoint doesn't provide any alias analysis information. Daniel, you said it doesn't make much sense to provide it but in my cases it is actually very much needed, you didn't say it wasn't possible to
2010 Jan 09
0
[LLVMdev] First-class aggregate semantics
Dustin Laurence wrote: > On 01/07/2010 06:03 PM, Alastair Lynn wrote: > >> You'll probably need to use insertvalue to construct your return value. >> > > Ah ha! > > The fact is I didn't really understand the significance of this part > when I read it, and so didn't remember it when I needed it. OK, so I > have tested it and I can now build
2019 Jul 02
2
RFC: Complex in LLVM
Tim Northover <t.p.northover at gmail.com> writes: > On Mon, 1 Jul 2019 at 19:56, David Greene via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> llvm.creal.* - Overloaded intrinsic to extract the real part of a >> complex value >> declare float @llvm.creal.c32(c32 %Val) >> declare double @llvm.creal.c64(c64 %Val) > > What are
2010 Jan 15
0
[LLVMdev] [PATCH] - Union types, attempt 2
I'm still working on the next patch, it's going somewhat slowly. I wanted to create a unit test that actually created a union, and in order to do that I had to implement constant unions. And rather than creating a special syntax for constructing a union, I decided that it was simplest to implement the insertvalue instruction for a constant union expression: @foo = constant union {
2016 Feb 07
5
Assigning constant value without alloca/load/store
Hello, I am currently trying to translate some custom IR to LLVM-IR and came across and issue. The custom IR has several registers and I am basically try to SSAfy it so it can be easily translated/converted to LLVM-IR. The problem: Since in my custom IR I can reassign every register I have to reassign every new expression with a new llvm Value. But my IR has something like this: REG A = VAR C
2010 Jan 13
7
[LLVMdev] [PATCH] - Union types, attempt 2
Here is the LangRef part of the patch. On Tue, Jan 12, 2010 at 2:11 PM, Chris Lattner <clattner at apple.com> wrote: > > On Jan 11, 2010, at 4:30 PM, Talin wrote: > > I'm working on a new version of the patch. >> >> Another thing I wanted to ask about - do you prefer to have one giant >> patch that has everything, or a series of incremental patches? I can
2009 Dec 02
1
[LLVMdev] LLVM 2.6 -> SVN breaks this
The LLVM 2.6-compatible IR below is derived from the HLVM test suite and is one of the things I've noticed going wrong. However, I just discovered that it works with LLVM 2.6 and with LLVM SVN when run through lli or llc without -tailcallopt but when I use: $ llvm-as -f aout.ll $ llc -tailcallopt -f aout.bc -o aout.s $ gcc -lm aout.s -o aout and the latest LLVM SVN it starts to print
2010 Jan 15
3
[LLVMdev] [PATCH] - Union types, attempt 2
2010/1/14 Talin <viridia at gmail.com>: > The reason for doing it this way is that to construct a union, you really > need 4 pieces of information: The type of the union, the type and value of > the member to be initialized, and the index of which member is being > initialized. Does requiring the index mean that uniquing the union type will have to re-write many of the
2011 Oct 23
1
[LLVMdev] Can insertvalue ignore its last operand?
Hi, Some of my code is compiled to %insert2 = insertvalue { float, float } %insert, float %33 When the index value (the last operand) is omitted, does it mean it uses some default value, say 0? The manual does not allow this syntax though. http://llvm.org/docs/LangRef.html#i_insertvalue Thanks. -- Jianzhou
2012 Dec 30
0
[LLVMdev] alignment issue, getting corrupt double values
I also saw this issue before. Llvm seems have trouble returning general struct values from functions. One easy workaround is to use packed struct type. Hope this helps. -Peng On Sunday, December 30, 2012, edA-qa mort-ora-y wrote: > I'm having an issue where a certain set of types and insert/extractvalue > are producing the incorrect values. It appears as though extractvalue >
2008 Jul 02
3
[LLVMdev] Plans considering first class structs and multiple return values
Hello, The basic infrastructure is in place. You can create first-class structs/arrays using sequences of insertvalue. For example, this: %t0 = insertvalue { i32, i32 } undef, i32 %a, 0 %t1 = insertvalue { i32, i32 } %t0, i32 %b, 1 creates the value with %a and %b as member values. Other ways to produce aggregate values are loads, function arguments, function return values, and literal
2010 Jan 08
0
[LLVMdev] First-class aggregate semantics
Hi Dustin- You'll probably need to use insertvalue to construct your return value. Alastair On 7 Jan 2010, at 21:56, Dustin Laurence wrote: > define %Token @foo() > { > ... > > ret %Token {%c_int %token, %i8* %value} > }
2010 Jan 15
1
[LLVMdev] [PATCH] - Union types, attempt 2
2010/1/15 Talin <viridia at gmail.com>: > On Thu, Jan 14, 2010 at 9:25 PM, me22 <me22.ca at gmail.com> wrote: >> >>    @foo = constant union { float, i32 } insertvalue union { i32, >> float } undef, i32 4, 0 >>    @bar = constant union { i32, float } insertvalue union { float, >> i32 } undef, i32 4, 1 >> > > Well, the fact that union members