Displaying 20 results from an estimated 52 matches for "getvalueid".
Did you mean:
getvalue
2009 Sep 28
2
[LLVMdev] Printing Function Arguments
...get access to 'i32' and '8' separately.
I do:
CallInst *CI = dyn_cast<CallInst>(I);
Value *v = CI->getOperand(1)
I can get the type via v->getType() and that returns 'i32', which is good.
But I also need to get the value '8'.
I can get it via v->getValueID(), but in the documentation it says not to
use that function.
Any other ideas what is the proper way to access the value '8' ?
thanks
--
View this message in context: http://www.nabble.com/Printing-Function-Arguments-tp25638981p25638981.html
Sent from the LLVM - Dev mailing list archiv...
2013 Mar 04
2
[LLVMdev] llvm cannot iterate a [3 x i8]
...ave :
...
Value *VV = cast<Value>(LD100->getOperand(1)->getOperand(0));
errs()<<"\n VV "<<*(VV)<<"\n";
RESULT : VV @.str = private unnamed_addr constant [3 x i8] c"DS\00",
section "llvm.metadata"
if(VV->getValueID() == Value::GlobalVariableVal){
GlobalVariable* FD = cast<GlobalVariable>(VV);
Value *VVV = cast<Value>(FD->getOperand(0));
errs()<<"\n VVV "<<*(VVV)<<"\n";
RESULT : VVV [3 x i8] c"DS\00"
if(V...
2012 Sep 26
0
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
...written
is encoded as relative to -> is encoded relative to
> static bool PushValueAndType(const Value *V, unsigned InstID,
> SmallVector<unsigned, 64> &Vals,
> ValueEnumerator &VE) {
> unsigned ValID = VE.getValueID(V);
> - Vals.push_back(ValID);
> + if (EnableOldStyleFunctions)
> + Vals.push_back(ValID);
> + else
> + Vals.push_back(InstID - ValID);
> if (ValID >= InstID) {
> Vals.push_back(VE.getTypeID(V->getType()));
> return true;
...
> @@ -1164,7 +1191...
2009 Sep 28
3
[LLVMdev] Printing Function Arguments
...*CI = dyn_cast<CallInst>(I);
>> Value *v = CI->getOperand(1)
>>
>> I can get the type via v->getType() and that returns 'i32', which is
>> good.
>>
>> But I also need to get the value '8'.
>>
>> I can get it via v->getValueID(), but in the documentation it says not to
>> use that function.
>
> Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the
> actual argument number.
>
>> Any other ideas what is the proper way to access the value '8' ?
>
>...
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
...>
> I do:
>
> CallInst *CI = dyn_cast<CallInst>(I);
> Value *v = CI->getOperand(1)
>
> I can get the type via v->getType() and that returns 'i32', which is good.
>
> But I also need to get the value '8'.
>
> I can get it via v->getValueID(), but in the documentation it says not to
> use that function.
Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the
actual argument number.
> Any other ideas what is the proper way to access the value '8' ?
It's a ConstantInt, so cast it a...
2017 Jun 12
4
How to know the sub-class of a Value class?
...(). Unless I know what the sub-type is, how can
>> I further use this object? I tried something like this:
>>
>> =================================================
>>
>> Value* value = store_inst->getValueOperand()
>> errs() << value->getValueID; // Which ID corresponds to which
>> sub-class?
>> errs() << value->getValueName(); // Prints numeric memory
>> addresses
>> errs() << *value->getValueName(); // Doesn't compile
>>
>> =======================================...
2017 Jun 12
4
How to know the sub-class of a Value class?
...ieve a Value* value =
store_inst->getValueOperand(). Unless I know what the sub-type is, how can
I further use this object? I tried something like this:
=================================================
Value* value = store_inst->getValueOperand()
errs() << value->getValueID; // Which ID corresponds to which
sub-class?
errs() << value->getValueName(); // Prints numeric memory addresses
errs() << *value->getValueName(); // Doesn't compile
=================================================
I have mentioned the issues in each of th...
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
...I);
>>> Value *v = CI->getOperand(1)
>>>
>>> I can get the type via v->getType() and that returns 'i32', which is
>>> good.
>>>
>>> But I also need to get the value '8'.
>>>
>>> I can get it via v->getValueID(), but in the documentation it says not
>>> to
>>> use that function.
>>
>> Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the
>> actual argument number.
>>
>>> Any other ideas what is the proper way to acc...
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...and create a new one only with a different type. I am trying
create a new Instruction thus:
%3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction
Value* Op0 = I->getOperand(0);
Value* Op1 = I->getOperand(1);
Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()),
Op0->getValueID());
Value* V1 = new Value(Type::getInt16Ty(Op1->getContext()),
Op1->getValueID());
Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test");
errs() << "NewInst:\n" << *newInst << "\n";
But I get something like this:
%test = add nsw...
2017 Jun 12
2
How to know the sub-class of a Value class?
...(). Unless I know what the sub-type is, how can
>> I further use this object? I tried something like this:
>>
>> =================================================
>>
>> Value* value = store_inst->getValueOperand()
>> errs() << value->getValueID; // Which ID corresponds to which
>> sub-class?
>> errs() << value->getValueName(); // Prints numeric memory
>> addresses
>> errs() << *value->getValueName(); // Doesn't compile
>>
>> =======================================...
2012 Sep 26
9
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
Hi all,
I've been looking into how to make llvm bitcode files smaller. There is
one simple change that appears to shrink linked bitcode files by about 15%.
See this spreadsheet for some rough data:
https://docs.google.com/spreadsheet/ccc?key=0AjRrJHQc4_bddEtJdjdIek5fMDdIdFFIZldZXzdWa0E
The change is in how operand ids are encoded in bitcode files. Rather than
use an "absolute
2007 Apr 20
3
[LLVMdev] SCEV ordering
...nd up using different entries for these.
The obvious solution would be to sort the values. Many SCEV types
could be ordered in reasonable ways, though for SCEVUnknown it
would require an ordering for Value objects, and I don't really
want this to get complicated. I'm considering just using
getValueID() as a primary sort and then using the value name to
sort values of the same kind. Using names is straight-forward, but
it could lead to spruious reorderings, since the names are
arbitrary.
Is there anything I'm missing here? Or, would there be other uses
for a general ordering for Values?
Da...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...etimes)?
I am trying
> create a new Instruction thus:
>
> %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction
>
> Value* Op0 = I->getOperand(0);
> Value* Op1 = I->getOperand(1);
> Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()),
> Op0->getValueID());
Hunh, Value's constructor is protected.
In any event, Value is pure base. Constructing one this way will never
get you what you want. If the ValueID indicates an Instruction, go
through Instruction to create one.
> Value* V1 = new Value(Type::getInt16Ty(Op1->getContext()),
> O...
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...create a new Instruction thus:
>>
>> %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction
>>
>> Value* Op0 = I->getOperand(0);
>> Value* Op1 = I->getOperand(1);
>> Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()),
>> Op0->getValueID());
>>
>
> Hunh, Value's constructor is protected.
>
> In any event, Value is pure base. Constructing one this way will never get
> you what you want. If the ValueID indicates an Instruction, go through
> Instruction to create one.
>
>
> Value* V1 = new Value(T...
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...two values that indicates non-equivalence (L less R, L greater R).
> [/new comment]
>
>
> >
> > +enum ConstantType {
> > I'm not sure that this buys you much. All the "isa" tests can be
> broken
> > down into a switch on getValueID() with the one exception of
> isNullValue().
> Done.
>
>
> > + assert(
> > + C1->getType()->__canLosslesslyBitCastTo(C2->__getType()) &&
> > + "Pass is healthless. checkForLosslessBitcast should be
> twin...
2012 May 09
0
[LLVMdev] How can I get the destination operand of an instruction?
...nstruction derives from
llvm::Value through llvm::User.
> The getOperand() returns an unsigned value like 0x9063498,
Uh? User::getOperand returns a Value*.
> while I can't
> find any instruction's method that returns unsigned value. I have tried
> getValue(),
You mean Value::getValueID, don't you?
> but it actually returns the opcode of the instruction instead of
> a unique value of of an instruction instance.
>
> Anyone gives any suggestions about this?
Read again the message you linked at the beginning.
2013 Jan 10
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
...&& ((previous->getNumOperands())>=2) )
errs()<<"\nTTTTT "<<previous->getOperand(0)->getName()<<" | "
<<previous->getOperand(0)->getValueName()<<" | "
<<previous->getOperand(0)->getValueID()<<" | "
<<previous->getOperand(0)->getNumUses()<<" TTTTT\n";
The results with getOperand(1) are similar. The output is:
*PREVIOUS: store i32 %conv15, i32* %i, align 4
TTTTT conv15 | 0x9b69090 | 59 | 1 TTTTT
...
*PREVIOUS: store i32 %inc13...
2013 Feb 28
0
[LLVMdev] how can I parse a Value* ?
...:
[1 x { i8*, i8*, i8*, i32 }] [{ i8*, i8*, i8*, i32 } { i8* bitcast (i32* @f
to i8*), i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i8*
getelementptr inbounds ([9 x i8]* @.str1, i32 0, i32 0), i32 18 }]
[1 x { i8*, i8*, i8*, i32 }]
2.
errs()<<"\n "<<(V->getValueID())<<"\n";
if(V->getValueID() == Value::ConstantArrayVal) {
ConstantArray *ca = (ConstantArray *)V;
errs()<<"\n "<<(ca[0])<<"\n"; }
RESULT :
[1 x { i8*, i8*, i8*, i32 }] [{ i8*, i8*, i8*, i32 } { i8* bitcast (i32* @f...
2007 Apr 13
1
[LLVMdev] getValueType
Anyone else ever get Value::getValueType and SDNode::getValueType
confused? They're very different things. Could I suggest a renaming
of Value::getValueType to getValueID?
Dan
--
Dan Gohman, Cray Inc.
2011 Jan 21
0
[LLVMdev] How to change the type of an Instruction?
On 21 January 2011 12:56, Douglas do Couto Teixeira <
douglasdocouto at gmail.com> wrote:
> Hello guys,
>
> I wonder how I can change the type of an integer variable. For instance,
> given the instruction "%3 = add i32 %1, %2" I would like to alter the
> instruction to "%3 = add i16 %1, %2". Is there any way to do this?
>
No. Instead you create a new