Displaying 15 results from an estimated 15 matches for "insertvalueinst".
2008 Jul 03
0
[LLVMdev] Plans considering first class structs and multiple return values
...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.
Is there anyway to do it using the C++ API? It seems I need an
instance of the aggregate type to pass into InsertValueInst::Create().
What is the API equivalent of "undef"?
Marc
On Wed, Jul 2, 2008 at 6:54 PM, Dan Gohman <gohman at apple.com> wrote:
> Hello,
>
> The basic infrastructure is in place. You can create first-class
> structs/arrays using sequences of insertvalue.
>
> For...
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
2009 May 17
1
[LLVMdev] [patch] Remove getType() overrides from extractvalue and insertvalue
...al instruction classes override getType() when the instruction
always creates a particular type of value. For example, the result of
insertelement is always a vector, so InsertElementInst overrides
getType() to return a VectorType*. This makes perfect sense.
However, ExtractValueInst and InsertValueInst override getType() to
return a PointerType*, which does not make sense and is in fact never
correct for the latter instruction; this is probably a relic of an
oversight during class creation. So this patch simply removes these
overrides, which I suppose is technically an API change.
John...
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...Start with an empty struct.
Value *Return = ConstantAggregateZero::get(NRetTy);
DEBUG(errs() << "Return: " << *Return->getType() << '\n');
// Insert the original return value in field 0
Return = InsertValueInst::Create(Return, RI->getOperand(0),
0, "ret", RI);
DEBUG(errs() << "Return: " << *Return->getType() << '\n');
// Insert the globals return value in field 1
Return = InsertValueInst::Create(Return, Lo...
2008 Sep 12
0
[LLVMdev] CPP API User-level Question: Returning multiple values
...uble %y, 1
ret { i64, double } %b
}
See the LangRef.html for details on the insertvalue instruction.
The -march=cpp backend in SVN trunk supports this too.
Also in svn trunk, if you're using the IRBuilder interface
you can use the CreateAggregateRet method, which takes care of
creating the InsertValueInsts for you.
Dan
2008 Sep 12
2
[LLVMdev] CPP API User-level Question: Returning multiple values
...gt; }
>
> See the LangRef.html for details on the insertvalue instruction.
> The -march=cpp backend in SVN trunk supports this too.
>
> Also in svn trunk, if you're using the IRBuilder interface
> you can use the CreateAggregateRet method, which takes care of
> creating the InsertValueInsts for you.
>
> Dan
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
2008 Jun 17
0
[LLVMdev] Transforming ConstantExprs to Instructions
...(for example, if the constant is a ConstantStruct), so be careful not
to assume that a constant derivation maps to a single instruction.
The case for ConstantExpr is probably the longest, but there aren't
actually that many cases: you just have GetElementPtrInst, CastInst,
CmpInst, SelectInst, InsertValueInst, and ExtractValueInst (assuming
you wouldn't try to prove the legality for anything involving
ptrtoint). (Okay, that list ended up a bit longer than I expected,
but it still isn't that long.)
-Eli
2008 Sep 12
3
[LLVMdev] CPP API User-level Question: Returning multiple values
Greetings,
I'm working on getting our compiler's interface to LLVM to mimic the
way the LLVM-GCC inserts instructions to generate AMD64 ABI compliant
code. I'm trying to create
ret i64 %mrv, double %double_mrv37
which is basically what LLVM-GCC puts out. However if I use lcc
-march=cpp to get the API code I need it has the following line:
2008 Sep 12
0
[LLVMdev] CPP API User-level Question: Returning multiple values
...the LangRef.html for details on the insertvalue instruction.
>> The -march=cpp backend in SVN trunk supports this too.
>>
>> Also in svn trunk, if you're using the IRBuilder interface
>> you can use the CreateAggregateRet method, which takes care of
>> creating the InsertValueInsts for you.
>>
>> Dan
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>
> _____________________...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...Start with an empty struct.
Value *Return = ConstantAggregateZero::get(NRetTy);
DEBUG(errs() << "Return: " << *Return->getType() << '\n');
// Insert the original return value in field 0
Return = InsertValueInst::Create(Return, RI->getOperand(0),
0, "ret", RI);
DEBUG(errs() << "Return: " << *Return->getType() << '\n');
// Insert the globals return value in field 1
Return = InsertValueInst::Create(Return, Lo...
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to
duplicate the function and add duplicated arguments in llvm, for
example:
func(int a, char *b) -> func(int a, char *b, int a1, char *b1)
I'm now stuck at using "getOrInsertFunction" and how to handle
"getArgumentList", please share your opinion, thanks a lot!
James
2008 Jun 17
4
[LLVMdev] Transforming ConstantExprs to Instructions
Hi,
I've been struggling with constantexprs for a bit. I'm working on a pass that
transforms global variables to local variables, and in particular the
GetElementPtrConstantExpr is a bit troublesome. For my transformation to
properly work, a global value should only be used by Instructions, not by
ConstantExprs.
I was thinking to add a ConstantExpr::replaceWithInstr() virtual method,
2012 Jul 31
0
[LLVMdev] rotate
Oh, no. I should have been more clear. The patch was not rejected, just
lost in the daily shuffle.
I already have my employer's approval to send this upstream, so I will
prepare a patch against trunk this morning.
> I proposed a similar patch to LLVM (left circular shift) around 10/2011.
> > Parts of my patch did make it into trunk about a year after, but others
> > did not.
2012 Jul 31
4
[LLVMdev] rotate
On Monday, July 30, 2012 12:16 AM, Cameron McInally wrote:
> Hey Andy,
>
> I proposed a similar patch to LLVM (left circular shift) around 10/2011.
> Parts of my patch did make it into trunk about a year after, but others
> did not.
>
> At that time, my solution was to add a binary operator to the IRBuilder,
> since LCS fits in nicely with the other shift operators. But,
2012 Jul 31
3
[LLVMdev] rotate
.../ extract from vector
-HANDLE_OTHER_INST(54, InsertElement, InsertElementInst) // insert into vector
-HANDLE_OTHER_INST(55, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
-HANDLE_OTHER_INST(56, ExtractValue, ExtractValueInst)// extract from aggregate
-HANDLE_OTHER_INST(57, InsertValue, InsertValueInst) // insert into aggregate
-HANDLE_OTHER_INST(58, LandingPad, LandingPadInst) // Landing pad instruction.
- LAST_OTHER_INST(58)
+ FIRST_OTHER_INST(46)
+HANDLE_OTHER_INST(46, ICmp , ICmpInst ) // Integer comparison instruction
+HANDLE_OTHER_INST(47, FCmp , FCmpInst ) // Floating point co...