search for: getvalueoperand

Displaying 20 results from an estimated 34 matches for "getvalueoperand".

2017 Jun 12
4
How to know the sub-class of a Value class?
As a concrete question, I understand 'Value' class is the parent of many concrete sub-classes. Let's say I retrieve 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-cla...
2011 Sep 04
1
[LLVMdev] correct types for ArgumentList?
...like this: Value *val = newFunc->arg_begin(); Value *ptr = ++(newFunc->arg_begin()); new StoreInst(val, ptr, block); But the only way I know to call is it is like this: vector<Value *> v_args; v_args.push_back(shadow); v_args.push_back(store->getValueOperand()); v_args.push_back(store->getPointerOperand()); ArrayRef<Value *> a_args(v_args); What is the correct way todo something like this? The full code for this simple pass is here: http://tinypaste.com/4df56 Thank you
2017 Jun 11
2
Force casting a Value*
I am trying to cast a Value* irrespective of its underlying subclass to uint64 and pass it on to a method as an argument. if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { Value* vo = store_inst->getValueOperand(); uint64 value = /* cast vo to unsigned int 64 bit */ func(value); } How can I force cast 'vo' to unsigned int? -- Thanks & Regards, Dipanjan -------------- next part -------------- An HTML attachment was scrubbed... URL: &l...
2018 Mar 09
4
Dump LLVM StoreInst
Hi, I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation. if (isa<StoreInst>(I)){ Value* v = I.getOperand(0); Instruction* op1 = dyn_cast<Instruction>(v); errs()<< v << "\t" << v1-getName()<<"\t"<<...
2017 Jun 12
4
How to know the sub-class of a Value class?
...Jun 12, 2017 at 3:24 PM, Dipanjan Das via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> >> As a concrete question, I understand 'Value' class is the parent of many >> concrete sub-classes. Let's say I retrieve 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->...
2017 Jun 11
2
Force casting a Value*
...rote: > >> >> I am trying to cast a Value* irrespective of its underlying subclass to >> uint64 and pass it on to a method as an argument. >> >> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { >> Value* vo = store_inst->getValueOperand(); >> uint64 value = /* cast vo to unsigned int 64 bit */ >> func(value); >> } >> >> How can I force cast 'vo' to unsigned int? >> >> -- >> >> Thanks & Regards, >> Dipan...
2017 Jun 12
2
Force casting a Value*
...s inserted using IRBuilder.CreateCall(). >> >> Consider the code snippet below. >> >> ================================================== >> >> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { >> Value* vo = store_inst->getValueOperand(); >> uint64 var_value = /* cast vo to unsigned int 64 bit >> */ >> >> // Pass on this value to external function >> IRBuilder<> builder(&I); >> builder.SetInsertPoint(&...
2011 Oct 12
1
[LLVMdev] getting object from BitCastInst?
My pass is looking at StoreInsts acting on global variable that happen to be function pointers. From these StoreInsts I would like to get useful information(the function used if a direct assignment, function pointer used, etc) from the getValueOperand() method. Looking through several examples I see that this can return several things like: GlobalVariable, Function, LoadInst or BitCastInst depending on how much "indirection" is used. In the case of BitCastInst my dump shows "%ptr.addr = alloca i8*, align 8", I would like to...
2018 Mar 10
0
Dump LLVM StoreInst
...ar 9, 2018 at 9:18 AM, Zhou Zhizhong via llvm-dev <llvm-dev at lists.llvm.org> wrote: > Hi, > > I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation. > If you want to check for loop invariance, LICM has logic for doing what you want. To track the evolution of a variable inside a loop, there's already an analysis, ScalarEvolution. In general, I'd reco...
2017 Jun 11
2
Force casting a Value*
...(char*) to an external function. The call to that function is inserted using IRBuilder.CreateCall(). Consider the code snippet below. ================================================== if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { Value* vo = store_inst->getValueOperand(); uint64 var_value = /* cast vo to unsigned int 64 bit */ // Pass on this value to external function IRBuilder<> builder(&I); builder.SetInsertPoint(&B, ++builder.GetInsertPoint()); C...
2017 Jun 12
2
How to know the sub-class of a Value class?
...un 11, 2017 at 10:54 PM, Dipanjan Das via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> >> As a concrete question, I understand 'Value' class is the parent of many >> concrete sub-classes. Let's say I retrieve 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->...
2017 Jun 11
2
Force casting a Value*
...m trying to cast a Value* irrespective of its underlying subclass >>>> to uint64 and pass it on to a method as an argument. >>>> >>>> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) { >>>> Value* vo = store_inst->getValueOperand(); >>>> uint64 value = /* cast vo to unsigned int 64 bit */ >>>> func(value); >>>> } >>>> >>>> How can I force cast 'vo' to unsigned int? >>>> >>>> -...
2018 Mar 10
0
Dump LLVM StoreInst
...t 9:18 AM, Zhou Zhizhong via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Hi, > > I’m writing a loop-free LLVM pass, my thought is to track if the value > inside the loop is changed, so I look up the Instruction StoreInst first > and try to get its value in a set. I checked getValueOperand(), > getValueName() in the API document but unfortunately they failed the > compilation. > > if (isa<StoreInst>(I)){ > Value* v = I.getOperand(0); > Instruction* op1 = dyn_cast<Instruction>(v); > errs()<< v << "\t" << v1-getNa...
2015 Feb 16
2
[LLVMdev] alias result
Oh, got it. Thanks for your explain. I misunderstand what getLocation does. If I would like to get the result of alias analysis referring to the stored value, what should I do in llvm? On 2/16/15 1:42 PM, Hal Finkel wrote: > ----- Original Message ----- >> From: "Haopeng Liu" <hyliuhp at gmail.com> >> To: "Hal Finkel" <hfinkel at anl.gov> >>
2014 Aug 07
2
[LLVMdev] MCJIT generates MOVAPS on unaligned address
...align 8 > > There is a bug in the SLPVectorizer however - it should be “align 4” - we get the alignment of the pointer type which is not what we want we want the alignment of the stored/loaded value. It should be > > if (!Alignment) > Alignment = DL->getABITypeAlignment(SI->getValueOperand()->getType()); r215162 fixes this bug. > > I am not sure that would fix your issue though, because that would mean we return the wrong alignment not none. > > If the call below returns 0 then something has gone wrong in setting up the data layout in your compilation pipeline. &...
2011 Nov 17
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...; + > + Type *T1, *T2; > + if (isa<StoreInst>(I)) { > + // For stores, it is the value type, not the pointer type that matters > + // because the value is what will come from a vector register. > + > + Value *Ival = cast<StoreInst>(I)->getValueOperand(); > + T1 = Ival->getType(); > + } > + else { > + T1 = I->getType(); > + } > + > + if (I->isCast()) { > + T2 = cast<CastInst>(I)->getSrcTy(); > + } > + else { > + T2 = T1; > + } >...
2012 Nov 14
4
[LLVMdev] About a problem in SROA
...ndex d95c855..696107a 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -2608,8 +2608,6 @@ private: assert(OldOp == OldPtr); IRBuilder<> IRB(&SI); - if (VecTy) - return rewriteVectorizedStoreInst(IRB, SI, OldOp); Type *ValueTy = SI.getValueOperand()->getType(); uint64_t Size = EndOffset - BeginOffset; @@ -2644,6 +2642,9 @@ private: return IsConvertable; } + if (VecTy) + return rewriteVectorizedStoreInst(IRB, SI, OldOp); + if (IntTy && ValueTy->isIntegerTy()) return rewriteIntegerStore(IRB,...
2011 Nov 21
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...*T2; > > + if (isa<StoreInst>(I)) { > > + // For stores, it is the value type, not the pointer type that matters > > + // because the value is what will come from a vector register. > > + > > + Value *Ival = cast<StoreInst>(I)->getValueOperand(); > > + T1 = Ival->getType(); > > + } > > + else { > > + T1 = I->getType(); > > + } > > + > > + if (I->isCast()) { > > + T2 = cast<CastInst>(I)->getSrcTy(); > > + } > > +...
2011 Sep 22
1
[LLVMdev] lli fine, compiled segfault?
I have a simple C test file I run a fairly simple Pass on. When I try to run the generated bitcode(after running the pass) with lli all is fine. When I try to compile this down to a actual elf executable I get a segfault. clang -emit-llvm -S test1.c -o test1.bc opt -load ~/llvm/Release+Asserts/lib/LLVMHello.so -hello < test1.bc > test1_pass.bc lli test1_pass.bc # All is fine llc
2011 Nov 16
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
Tobias, et al., Attached is the my autovectorization pass. I've fixed a bug that appears when using -bb-vectorize-aligned-only, fixed some 80-col violations, etc., and at least on x86_64, all test cases pass except for a few; and all of these failures look like instruction-selection bugs. For example: MultiSource/Applications/ClamAV - fails to compile shared_sha256.c with an error: error in