search for: createnswadd

Displaying 9 results from an estimated 9 matches for "createnswadd".

2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...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 i16 <badref>, <badref> ; <i16> [#uses=0] What I am doing wrong? Best, Douglas On Fri, Jan 21, 2011 at 8:25 PM, Nick...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...alue 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()), > Op1->getValueID()); > Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test"); > errs() << "NewInst:\n" << *newInst << "\n"; > > > But I get something like this: > > %test = add nsw i16 <badref>, <badref> ; <i16> [#uses=0] The two instructions V0 and V1 you created were never...
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...cting 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()), >> Op1->getValueID()); >> Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test"); >> errs() << "NewInst:\n" << *newInst << "\n"; >> >> >> But I get something like this: >> >> %test = add nsw i16 <badref>, <badref> ; <i16> [#uses=0] >> > > The two ins...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...> 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()), > Op1->getValueID()); > Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, > "test"); > errs() << "NewInst:\n" << *newInst << "\n"; > > > But I get something like this: > > %test = add nsw i16 <badref>, <badref> ; <i16> [#uses=0] > > >...
2011 Jan 28
1
[LLVMdev] How to change the type of an Instruction?
...r 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()), >>> Op1->getValueID()); >>> Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test"); >>> errs() << "NewInst:\n" << *newInst << "\n"; >>> >>> >>> But I get something like this: >>> >>> %test = add nsw i16 <badref>, <badref> ; <i16> [#uses=0] >&g...
2010 Apr 14
0
[LLVMdev] Operand, instruction
...> ‘llvm::Instruction’:", "Instruction.h:50: note: virtual llvm::Instruction* > llvm::Instruction::clone(llvm::LLVMContext&) const" > An add or sub should be a BinaryOperator, if memory serves me correctly. Looking at mainline doxygen, there's a whole bunch of CreateNSWAdd, CreateNSWMul, etc. methods. It's one of those that you want. -- John T. > Also i have used BinaryOperator::create(), but it gives error that there is > no function called create(). > > Thanks again for your reply. > > > John Criswell-2 wrote: > >> help__me_p...
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
2010 Apr 14
4
[LLVMdev] Operand, instruction
Thanks for reply. I have used AllocaInst, it's working but i think it's only for allocating some memory for new variable. And CallInst creates a call instruction. I am looking for creating a add or sub instruction. I used function instruction(), which gives me error "error: cannot allocate an object of abstract type ‘llvm::Instruction’" and also "Instruction.h:28: note:
2011 Jan 21
2
[LLVMdev] How to change the type of an Instruction?
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? Best wishes, Douglas -------------- next part -------------- An HTML attachment was scrubbed... URL: