search for: insertvalu

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

Did you mean: insertvalue
2016 Feb 10
4
Memory Store/Load Optimization Issue (Emulating stack)
...%sp_3_ptr = bitcast i8* %sp_2 to i32* %val1 = load i32, i32* %sp_3_ptr, align 4 %sp_3 = getelementptr i8, i8* %sp_2, i32 4 ; val2 = pop (val2 = foo) %sp_4_ptr = bitcast i8* %sp_3 to i32* %val2 = load i32, i32* %sp_4_ptr, align 4 %sp_4 = getelementptr i8, i8* %sp_3, i32 4 %ret_1 = insertvalue { i32, i32, i8* } undef, i32 %val1, 0 %ret_2 = insertvalue { i32, i32, i8* } %ret_1, i32 %val2, 1 %ret_3 = insertvalue { i32, i32, i8* } %ret_2, i8* %sp_4, 2 ret { i32, i32, i8* } %ret_3 } After optimization ("opt -instcombine ./code.ll -S") define { i32, i32, i8* } @test(i32 %f...
2016 Feb 08
2
Memory Store/Load Optimization Issue (Emulating stack)
...ign 4 ; val1 = pop (val1 = bar) %sp_3_ptr = inttoptr i32 %sp_2 to i32* %val1 = load i32, i32* %sp_3_ptr, align 4 %sp_3 = add i32 %sp_2, 4 ; val2 = pop (val2 = foo) %sp_4_ptr = inttoptr i32 %sp_3 to i32* %val2 = load i32, i32* %sp_4_ptr, align 4 %sp_4 = add i32 %sp_3, 4 %ret_1 = insertvalue { i32, i32, i32 } undef, i32 %val1, 0 %ret_2 = insertvalue { i32, i32, i32 } %ret_1, i32 %val2, 1 %ret_3 = insertvalue { i32, i32, i32 } %ret_2, i32 %sp_4, 2 ret { i32, i32, i32 } %ret_3 } This code will "push" two values onto the stack and pop them in reverse order so afterwards...
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 (NumEleme...
2012 Dec 30
2
[LLVMdev] alignment issue, getting corrupt double values
...rect (not what was inserted). I think extraction is the problem and not insertion: in another version I store the value to a global variable and dump the bytes of the structure, which can then be properly extracted in C++ code. The value is produced with this code (in a separate function): %s0 = insertvalue %inner undef, double 1.500000e+00, 0 %s1 = insertvalue %inner %s0, i32 2, 1 %s2 = insertvalue %outer undef, i32 1, 0 %s3 = insertvalue %outer %s2, %inner %s1, 1 I've attached the full sample code which shows the error and where it happens. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- --...
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)
...3_ptr, align 4 >> %sp_3 = getelementptr i8, i8* %sp_2, i32 4 >> >> ; val2 = pop (val2 = foo) >> %sp_4_ptr = bitcast i8* %sp_3 to i32* >> %val2 = load i32, i32* %sp_4_ptr, align 4 >> %sp_4 = getelementptr i8, i8* %sp_3, i32 4 >> >> %ret_1 = insertvalue { i32, i32, i8* } undef, i32 %val1, 0 >> %ret_2 = insertvalue { i32, i32, i8* } %ret_1, i32 %val2, 1 >> %ret_3 = insertvalue { i32, i32, i8* } %ret_2, i8* %sp_4, 2 >> >> ret { i32, i32, i8* } %ret_3 >> } >> >> After optimization ("opt -instcombi...
2013 Mar 30
2
[LLVMdev] Missed optimisation opportunities?
...lightly 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 all over the place. So when compiling this simple CS example; function long fib (long al_x) long ll_i=0, ll_ret=0, ll_last=0, ll_last2=1 if isnull(al_x) then return al_x end if ll_i=1 do while ll_i<=al_x ll_ret=ll_last+ll_last2 ll_last2=ll_last ll_last=ll_ret...
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
...3_ptr, align 4 >> %sp_3 = getelementptr i8, i8* %sp_2, i32 4 >> >> ; val2 = pop (val2 = foo) >> %sp_4_ptr = bitcast i8* %sp_3 to i32* >> %val2 = load i32, i32* %sp_4_ptr, align 4 >> %sp_4 = getelementptr i8, i8* %sp_3, i32 4 >> >> %ret_1 = insertvalue { i32, i32, i8* } undef, i32 %val1, 0 >> %ret_2 = insertvalue { i32, i32, i8* } %ret_1, i32 %val2, 1 >> %ret_3 = insertvalue { i32, i32, i8* } %ret_2, i8* %sp_4, 2 >> >> ret { i32, i32, i8* } %ret_3 >> } >> >> After optimization ("opt -instcombi...
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 up a struct like this > >...
2019 Jul 02
2
RFC: Complex in LLVM
...ct the real part of a >> complex value >> declare float @llvm.creal.c32(c32 %Val) >> declare double @llvm.creal.c64(c64 %Val) > > What are your plans for the reverse? I assume we don't want the only > way to materialize a complex to be via memory so an insertvalue > equivalent (or maybe using insertvalue/extractvalue directly?) and a > literal value would probably be useful. Good points. Originally I put the creal/cimag intrinsics in the proposal when the layout of the complex type was left unspecified. After internal feedback, I changed it to an ex...
2010 Jan 15
0
[LLVMdev] [PATCH] - Union types, attempt 2
...ll 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 { i32, float } insertvalue union { i32, float } undef, i32 4, 0 What this says is to start with an undef, and then insert the value '4' into the integer field (the zeroth field) of the union. The reason for doing it...
2016 Feb 07
5
Assigning constant value without alloca/load/store
..._c) { ; Initializing registers %reg_a_0 = select i1 true, i32 0, i32 0 %reg_b_0 = select i1 true, i32 0, i32 0 %reg_c_0 = select i1 true, i32 0, i32 0 ; Translated instructions %reg_a_1 = add i32 %var_c, 2 %reg_a_2 = select i1 true, i32 12, i32 0 ; Prepare return values %ret_0 = insertvalue { i32, i32, i32 } undef, i32 %reg_a_2, 0 %ret_1 = insertvalue { i32, i32, i32 } %ret_0, i32 %reg_b_0, 1 %ret_2 = insertvalue { i32, i32, i32 } %ret_1, i32 %reg_c_0, 2 ret { i32, i32, i32 } %ret_2 } I am basically using "select i1 true, i32 1, i32 0" so after optimization it gets:...
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
...) declare void @exit(i32) declare i32 @printf(i8*, ...) define fastcc i32 @gc_check() { ret i32 0 } define fastcc i32 @pixel(i32, double, double, double, double) { entry: br label %start start: ; preds = %entry %5 = insertvalue %4 undef, i32 %0, 0 ; <%4> [#uses=1] %6 = insertvalue %4 %5, double %1, 1 ; <%4> [#uses=1] %7 = insertvalue %4 %6, double %2, 2 ; <%4> [#uses=1] %8 = insertvalue %4 %7, double %3, 3 ; <%4> [#uses=1] %9 = insertvalu...
2010 Jan 15
3
[LLVMdev] [PATCH] - Union types, attempt 2
...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 corresponding insertvalue calls? For instance, how would this round-trip? @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 I'm very glad to see a non-bitcast method of using unions, BTW.
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
...k extraction > is the problem and not insertion: in another version I store the value > to a global variable and dump the bytes of the structure, which can then > be properly extracted in C++ code. The value is produced with this code > (in a separate function): > > %s0 = insertvalue %inner undef, double 1.500000e+00, 0 > %s1 = insertvalue %inner %s0, i32 2, 1 > %s2 = insertvalue %outer undef, i32 1, 0 > %s3 = insertvalue %outer %s2, %inner %s1, 1 > > > I've attached the full sample code which shows the error and where it > happ...
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 constants. It...
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 have to be indexed by number means that > the ordering has to be part of the type. >...