Displaying 20 results from an estimated 109 matches for "getinstlist".
2004 Aug 04
0
[LLVMdev] moving instructions
How does one move instructions from one basic block to another? I tried
this:
(IB is an Instruction* as is current_last, current_BB is a BasicBlock*)
IB->getParent()->getInstList().remove(IB);
current_BB->getInstList().insert(current_last, IB);
and I get this assertion:
Assertion `V->getParent() == 0 && "Value already in a container!!"' failed.
it seems to me that remove should remove it from it's container....
2004 Aug 17
5
[LLVMdev] JIT API example (fibonacci)
...= FibF->afront(); // Get the arg
> > ArgX.setName("AnArg"); // Give it a nice symbolic name for fun.
> >
> > SetCondInst* CondInst
> > = new SetCondInst( Instruction::SetLE,
> > &ArgX, Two );
> >
> > BB->getInstList().push_back(CondInst);
> >
> > // Create the true_block
> > BasicBlock* true_bb = new BasicBlock("arg<=2");
> >
> >
> > // Create the return instruction and add it
> > // to the basic block for true case:
> > true_bb-&...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...;
> Argument &ArgX = FibF->afront(); // Get the arg
> ArgX.setName("AnArg"); // Give it a nice symbolic name for fun.
>
> SetCondInst* CondInst
> = new SetCondInst( Instruction::SetLE,
> &ArgX, Two );
>
> BB->getInstList().push_back(CondInst);
>
> // Create the true_block
> BasicBlock* true_bb = new BasicBlock("arg<=2");
>
>
> // Create the return instruction and add it
> // to the basic block for true case:
> true_bb->getInstList().push_back(new Retur...
2004 Aug 04
4
[LLVMdev] error building updated LLVM
> Compiling InstrSelectorEmitter.cpp
> InstrSelectorEmitter.cpp: In member function `virtual void
> llvm::InstrSelectorEmitter::run(std::ostream&)':
> InstrSelectorEmitter.cpp:1295: internal compiler error: in
> convert_from_eh_region_ranges_1, at except.c:1159
> Please submit a full bug report,
GCC 3.3.2 is not compatible with LLVM, sorry!
-Chris
> with
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...t(); // Get the arg
>>> ArgX.setName("AnArg"); // Give it a nice symbolic name for fun.
>>>
>>> SetCondInst* CondInst
>>> = new SetCondInst( Instruction::SetLE,
>>> &ArgX, Two );
>>>
>>> BB->getInstList().push_back(CondInst);
>>>
>>> // Create the true_block
>>> BasicBlock* true_bb = new BasicBlock("arg<=2");
>>>
>>>
>>> // Create the return instruction and add it
>>> // to the basic block for true case:
>&g...
2004 Aug 18
1
[LLVMdev] JIT API example (fibonacci)
...gt; ArgX.setName("AnArg"); // Give it a nice symbolic name for fun.
> >>>
> >>> SetCondInst* CondInst
> >>> = new SetCondInst( Instruction::SetLE,
> >>> &ArgX, Two );
> >>>
> >>> BB->getInstList().push_back(CondInst);
> >>>
> >>> // Create the true_block
> >>> BasicBlock* true_bb = new BasicBlock("arg<=2");
> >>>
> >>>
> >>> // Create the return instruction and add it
> >>> // to th...
2004 Aug 17
4
[LLVMdev] JIT API example (fibonacci)
Hi LLVMers,
the example attached I have used to prove that JIT and some visible
optimizations are really invoked.
Proved OK. I got 30% speed-up in comparison to gcc 3.3.3
on my Athlon XP 1500.
Nice.
P.S. guys, no fears, I don't plan to flood the cvs repository
with my "brilliant" examples ;)
---
Valery A.Khamenya
-------------- next part --------------
An
2004 May 21
1
[LLVMdev] Re: LLVMdev digest, Vol 1 #292 - 4 msgs
Hi,
Thank Brian Gaeke so much.
Following TraceBasicBlocks.cpp, I modified the code as below and could insert instruction or function I need into anywhere in Module.
But it works well without BB->getInstList().push_back(InstrCall), and if I add the BB->getInstList().push_back() following new CallInst(), I got error information when runing opt. What is the reason for it? And is it necessary to add push_back()
after new CallInst ? And if I used those two instructions , it works well. Thanks
Instructi...
2016 Sep 05
2
LLVM 3.8.0 - Adding new instruction to a basic block
...:06 PM, Simona Simona via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hello,
>>
>> I'm trying to add a new instruction after a given instruction in a basic
>> block.
>> Until LLVM 3.7, I was using the following code:
>>
>> BB->getInstList().insertAfter(I, new_inst);
>> [where both I and new_inst are Instruction*]
>>
>> In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
>> iplist.
>> Could anyone please tell me how I can do the same type of insertion in
>> LLVM 3.8?
>>...
2004 May 02
1
[LLVMdev] hoisting problem.
...lt; "HOIST\n");
//remove instruction, and stick it in the preheader,
BEFORE
//the last Instruction of that block (which is a branch)
Instruction* I2 = I->clone();
I2->setName("Billy");
I->replaceAllUsesWith(I2);
I->getParent()->getInstList().remove(I);
//we want to insert before the
//branch at the end
iplist<Instruction> preheaderInsts =
L->getLoopPreheader()->getInstList();
iplist<Instruction>::iterator i = preheaderInsts.end();
i--;
preheaderInsts.insert(i, I2);...
2005 Feb 17
0
[LLVMdev] Branching to Entry block
On Thu, Feb 17, 2005 at 01:22:22PM -0600, Chris Lattner wrote:
> // Approach number 2, the more explicit way:
> BB->getParent()->getInstList().erase(BB); // Remove from list & delete
>
> // Approach number 3, remove from the list, then delete it explicitly:
> BB->getParent()->getInstList().remove(BB); // Just remove from list
> delete BB; // Delete block
Minor correction...
2016 Sep 04
2
LLVM 3.8.0 - Adding new instruction to a basic block
Hello,
I'm trying to add a new instruction after a given instruction in a basic
block.
Until LLVM 3.7, I was using the following code:
BB->getInstList().insertAfter(I, new_inst);
[where both I and new_inst are Instruction*]
In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
iplist.
Could anyone please tell me how I can do the same type of insertion in LLVM
3.8?
Thank you and Regards,
Simona
-------------- next part ------...
2016 Sep 05
2
LLVM 3.8.0 - Adding new instruction to a basic block
...lvm.org> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm trying to add a new instruction after a given instruction in a
>>>> basic block.
>>>> Until LLVM 3.7, I was using the following code:
>>>>
>>>> BB->getInstList().insertAfter(I, new_inst);
>>>> [where both I and new_inst are Instruction*]
>>>>
>>>> In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
>>>> iplist.
>>>> Could anyone please tell me how I can do the same type of i...
2005 Feb 17
4
[LLVMdev] Branching to Entry block
...there is that you're trying to delete some basic block that is
still embedded into a function. There are several ways to accomplish
this:
BasicBlock *BB = ...
// Approach number 1, the easy way:
BB->eraseFromParent();
// Approach number 2, the more explicit way:
BB->getParent()->getInstList().erase(BB); // Remove from list & delete
// Approach number 3, remove from the list, then delete it explicitly:
BB->getParent()->getInstList().remove(BB); // Just remove from list
delete BB; // Delete block
I strongly suggest using approach #1...
2013 Jul 25
2
[LLVMdev] Error for AllocaInst and Instruction
Hi,
For the following code
const Type * Int32Type =
IntegerType::getInt32Ty(getGlobalContext());
AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb);
Bb->getInstList().push_back(newInst);
It gives me the error
" error: no matching constructor for initialization of 'llvm::AllocaInst'
AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb);"
By using Instruction
const Type * Int32Type =
IntegerType::getI...
2005 May 11
3
[LLVMdev] Question About inserting Instruction?
...nstructions to dummy/dead BB, however, I really want to insert some illegal instructions/any thing into those BB since those instructions have no chance to be executed. I am not sure if it could be done or not.
For example,
Correct way:
Instruction *NewInst = new LoadInst(...);
NewBB->getInstList().push_back(NewInst);
what I need just put some junk data in the BB, not instructions. From assemble code level, it looks like the following,
a piece of code from correct instructions by disassemble object code.
:00000009 0533709283 add eax, 83927033
:0000000E 05A2B78135...
2008 Apr 16
2
[LLVMdev] Problems in removing a cloned instruction.
...;< *RI<< "\n";
Instruction *NewRInst = new ReturnInst(); // creating
a new return instruction
Value *v = NULL;
if (II->hasName())
NewRInst->setName(II->getName()+NameSuffix);
NewBB->getInstList().push_back(NewRInst);
ValueMap[II] = NewRInst; // Add
instruction map to value.
hasCalls |= isa<CallInst>(II);
}
if (II->hasName())
NewInst->setName(II->getName()+NameSuffix);...
2003 Nov 21
2
[LLVMdev] Need Help With Verifier
...s but I assume its just an
invalid references of some sort. The only thing I store into the array
is an "IntTy". I use a GEP instruction to index into the stack and then
generate the store instruction like this:
> ConstantInt* val = ConstantInt::get( Type::IntTy, value );
> bb->getInstList().push_back( new StoreInst( val, gep ) );
How could this "ConstantInt" value be reported as "void <badref>" ?
The next thing that troubles me is that the verifier output for the
second operand indicates a two dimensional array. This just isn't right,
its one dimensio...
2012 Aug 22
1
[LLVMdev] Insert Self Written Function Call from a FunctionPass?
...in the start of the first basic block*/
virtual bool insertOnFirstBlock(Function::iterator &BB)
{
for(BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI
!= BE; ++BI)
{
if(BI == BB->begin())
{
BB->getInstList().insert((Instruction*)BI, count);
break;
}//end of if
}
return true;
}
virtual bool runOnBasicBlock(Function::iterator &BB)
{
for(BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI
!= BE; ++BI)
{...
2008 Apr 16
0
[LLVMdev] Problems in removing a cloned instruction.
...gt;
> Instruction *NewRInst = new ReturnInst(); // creating a new return instruction
> Value *v = NULL;
>
> if (II->hasName())
> NewRInst->setName(II->getName()+NameSuffix);
> NewBB->getInstList().push_back(NewRInst);
> ValueMap[II] = NewRInst; // Add instruction map to value.
> hasCalls |= isa<CallInst>(II);
Can this one ever be true? Intuitively, if II is a ReturnInst (which is the
case inside this if), it can't be a CallInst...