Displaying 20 results from an estimated 45 matches for "insertpos".
2010 Apr 08
4
[LLVMdev] How to Load a Value?
Hello,
I have a problem of generating a load instruction. The LLVM bytecode is:
------------------------
entry:
...
%2 = call i32 (...)* @atoi(i8*%1) nounwind
/*<- Insertpos*/
...
--
bb1:
..
%5 = icmp sgt i32 %2, %i.0
...
-----------------
Now I have
pb: pointer to the Value object of *%2* of bb1.
Here, I want to generate a load instruction and I did it as:
new LoadInst(pb, "load_2", InsertPos);
where InsertPos points to the position immediately af...
2012 Aug 28
2
[LLVMdev] Assert in LiveInterval update
...;<< Here we make
sure that CurrentTop != MI.
CurrentTop = nextIfDebug(++CurrentTop, CurrentBottom);
else {
moveInstruction(MI, CurrentTop);
TopRPTracker.setPos(MI);
}
...
But in moveInstruction we use
// Update the instruction stream.
BB->splice(InsertPos, BB, MI);
And splice as far as I understand moves MI to the location right __before__
InsertPos. Our previous check made sure that InsertPos != MI,
But I do hit a case, when MI == InsertPos--, and effectively tries to swap
instruction with itself... which make live update mechanism very unhappy....
2012 Aug 28
0
[LLVMdev] Assert in LiveInterval update
...MI.
> CurrentTop = nextIfDebug(++CurrentTop, CurrentBottom);
> else {
> moveInstruction(MI, CurrentTop);
> TopRPTracker.setPos(MI);
> }
> ...
>
> But in moveInstruction we use
>
> // Update the instruction stream.
> BB->splice(InsertPos, BB, MI);
>
> And splice as far as I understand moves MI to the location right __before__
> InsertPos. Our previous check made sure that InsertPos != MI,
> But I do hit a case, when MI == InsertPos--, and effectively tries to swap
> instruction with itself... which make live update...
2005 Oct 16
2
[LLVMdev] Help on LLVM Instrumentation
Hi ,
I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation :
1) injecting LLVM bytecode instructions
2) calling an external C function.
I am trying both and
2011 Dec 05
0
[LLVMdev] RFC: Machine Instruction Bundle
...me information about how the register handles this extension.
First of all, I agree it is important that this can be used for more than VLIW targets. Besides the uses you mention, I would like to use bundle DBG_VALUE instructions so we can avoid silly code like this:
MachineBasicBlock::iterator InsertPos = mi;
while (InsertPos != MBB->begin() && llvm::prior(InsertPos)->isDebugValue())
--InsertPos;
MachineBasicBlock::iterator From = KillMI;
MachineBasicBlock::iterator To = llvm::next(From);
while (llvm::prior(From)->isDebugValue())
--From;
I also think bundles can...
2012 Aug 28
5
[LLVMdev] Assert in LiveInterval update
...rentTop, CurrentBottom);
> > else {
> > moveInstruction(MI, CurrentTop);
> > TopRPTracker.setPos(MI);
> > }
> > ...
> >
> > But in moveInstruction we use
> >
> > // Update the instruction stream.
> > BB->splice(InsertPos, BB, MI);
> >
> > And splice as far as I understand moves MI to the location right
> > __before__ InsertPos. Our previous check made sure that InsertPos !=
> > MI, But I do hit a case, when MI == InsertPos--, and effectively
> tries
> > to swap instruction with itse...
2010 Apr 08
0
[LLVMdev] How to Load a Value?
Zheng Wang <jason.wangz at gmail.com> writes:
> I have a problem of generating a load instruction. The LLVM bytecode is:
>
> ------------------------
> entry:
> ...
> %2 = call i32 (...)* @atoi(i8*%1) nounwind
> /*<- Insertpos*/
> ...
>
> --
> bb1:
> ..
> %5 = icmp sgt i32 %2, %i.0
> ...
> -----------------
>
>
> Now I have
>
> pb: pointer to the Value object of *%2* of bb1.
>
> Here, I want to generate a load instruction and I did it as:
>
> new LoadInst(pb, "l...
2011 May 18
3
[LLVMdev] access array problem
...stant *>index(2);
index[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
index[1] = Constant::get(Type::getInt32Ty(Context), 0);
Constant *ElementPtr = ConstantExpr::getGetElementPtr(counter,
&index[0], index.size());
Value *oldcounter = new LoadInst(ElementPtr, "oldcounter", InsertPos);
Value *newcounter = BinaryOperator::Create(Instruction::Add,
oldcounter, ConstantInt::get(Type::getInt64Ty(Context), 1),
"newcounter", InsertPos);
new StoreInst(newcounter, ElmentPtr, InserPos);
//store the memory address to counterArray[oldcounter]
std::vector<Constant*> indexC(...
2012 Aug 30
0
[LLVMdev] Assert in LiveInterval update
...{
> > > moveInstruction(MI, CurrentTop);
> > > TopRPTracker.setPos(MI);
> > > }
> > > ...
> > >
> > > But in moveInstruction we use
> > >
> > > // Update the instruction stream.
> > > BB->splice(InsertPos, BB, MI);
> > >
> > > And splice as far as I understand moves MI to the location right
> > > __before__ InsertPos. Our previous check made sure that InsertPos !=
> > > MI, But I do hit a case, when MI == InsertPos--, and effectively
> > tries
> > >...
2012 Aug 31
2
[LLVMdev] Assert in LiveInterval update
...rentTop, CurrentBottom);
> > else {
> > moveInstruction(MI, CurrentTop);
> > TopRPTracker.setPos(MI);
> > }
> > ...
> >
> > But in moveInstruction we use
> >
> > // Update the instruction stream.
> > BB->splice(InsertPos, BB, MI);
> >
> > And splice as far as I understand moves MI to the location right
> > __before__ InsertPos. Our previous check made sure that InsertPos !=
> > MI, But I do hit a case, when MI == InsertPos--, and effectively
> tries
> > to swap instruction with itse...
2011 May 18
0
[LLVMdev] access array problem
...2Ty(Context), 0);
The above two lines both compute the same thing (an i32 constant equal to
zero) in two different ways.
> Constant *ElementPtr = ConstantExpr::getGetElementPtr(counter,
> &index[0], index.size());
> Value *oldcounter = new LoadInst(ElementPtr, "oldcounter", InsertPos);
> Value *newcounter = BinaryOperator::Create(Instruction::Add,
> oldcounter, ConstantInt::get(Type::getInt64Ty(Context), 1),
> "newcounter", InsertPos);
> new StoreInst(newcounter, ElmentPtr, InserPos);
>
> //store the memory address to counterArray[oldcounter]
> st...
2004 May 21
1
[LLVMdev] Re: LLVMdev digest, Vol 1 #292 - 4 msgs
...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
Instruction *InstrCall = new CallInst (InstrFn, Args , "");
BB->getInstList().insert(InsertPos,InstrCall);
Error inforamtion:
%opt -load ../../lib/Debug/libcntPass.so -cntPass<insert.bc -f -o i.bc
BB name : entry
opt: SymbolTableListTraitsImpl.h:53: void llvm::SymbolTableListTraits<ValueSubClass, ItemParentClass, SymTabClass, SubClass>::addNodeToList(ValueSubClass*) [with Val...
2012 Aug 17
0
[LLVMdev] Assert in LiveInterval update
...angesFrom
(this=0x7fffffff8010, MI=0x462ab80, OldIdx=...) at
lib/CodeGen/LiveIntervalAnalysis.cpp:938
#8 in llvm::LiveIntervals::handleMove (this=0x448b6f0, MI=0x462ab80) at
lib/CodeGen/LiveIntervalAnalysis.cpp:1388
#9 in llvm::VLIWMachineScheduler::moveInstruction (this=0x46b0f50,
MI=0x462ab80, InsertPos=...) at
lib/Target/Hexagon/HexagonMachineScheduler.cpp:120
#10 in llvm::VLIWMachineScheduler::schedule (this=0x46b0f50) at
lib/Target/Hexagon/HexagonMachineScheduler.cpp:378
#11 in (anonymous namespace)::MachineScheduler::runOnMachineFunction
(this=0x448c730, mf=...) at lib/CodeGen/MachineSche...
2011 May 18
2
[LLVMdev] access array problem
...ext));
IndicesC[1] = ConstantInt::get(Type::getInt32Ty(Context),0);
Constant *ElementPtrC =
ConstantExpr::getGetElementPtr(CounterSize,&IndicesC[0],IndicesC.size());
Value *OldCounterSize
=new LoadInst(ElementPtrC, "OldCounterSize", InsertPos);
Value *OldCounterSize =new LoadInst(ElementPtrC, "", InsertPos);
//create a getelementptr instruction: we want get &Counters[OldCounterSize]
std::vector<Value*>new_idx;
new_idx.push_back(OldCounterSize); // ERROR?
Value *nextaddr = GetElementPtrInst::Create(Counters, new_id...
2012 Aug 30
0
[LLVMdev] MC Register mapping question (MCRegUnitIterator )
...{
> > > moveInstruction(MI, CurrentTop);
> > > TopRPTracker.setPos(MI);
> > > }
> > > ...
> > >
> > > But in moveInstruction we use
> > >
> > > // Update the instruction stream.
> > > BB->splice(InsertPos, BB, MI);
> > >
> > > And splice as far as I understand moves MI to the location right
> > > __before__ InsertPos. Our previous check made sure that InsertPos
> !=
> > > MI, But I do hit a case, when MI == InsertPos--, and effectively
> > tries
> >...
2005 Feb 07
0
[LLVMdev] Segmentation Fault(Modifying BasicBlockPlacement.cpp)
Thanks a lot for replying Chris,
I m trying to randomize the blocks in a program.I generate a random number( between the
current "InsertPos" and the last block), and then iterate through the list of basicblocks , picking up block with position equal to that of the random number and place it into the current InsertPos and increment InsertPos.
Running it like this:
------------------------------------------------------------------...
2005 Feb 02
1
[LLVMdev] RE: Question about Global Variable
...%tmp.34 = getelementptr sbyte* %tmp.32, int %tmp.33 ; <sbyte*> [#uses=1]
I am trying to construct all those IR instructions, for the first three, it is ok, as the following
GetElementPtrInst *GEP = new GetElementPtrInst( pGVars, idxVec, "GetAryElement", InsertPos);
Value *ldAddr = new LoadInst(GEP,"LdAryAddr",InsertPos);
Value *ldAddr1 = new LoadInst(numidx, "idx_i", InsertPos);
After this I need construct another getelementptr, and from the above IR code, the second getelementptr take the result of load as parameters. But there is no...
2012 Aug 31
0
[LLVMdev] Assert in LiveInterval update
...rentTop, CurrentBottom);
> > else {
> > moveInstruction(MI, CurrentTop);
> > TopRPTracker.setPos(MI);
> > }
> > ...
> >
> > But in moveInstruction we use
> >
> > // Update the instruction stream.
> > BB->splice(InsertPos, BB, MI);
> >
> > And splice as far as I understand moves MI to the location right
> > __before__ InsertPos. Our previous check made sure that InsertPos !=
> > MI, But I do hit a case, when MI == InsertPos--, and effectively
> tries
> > to swap instruction with itse...
2012 Aug 30
2
[LLVMdev] MC Register mapping question (MCRegUnitIterator )
...ruction(MI, CurrentTop);
>> > > TopRPTracker.setPos(MI);
>> > > }
>> > > ...
>> > >
>> > > But in moveInstruction we use
>> > >
>> > > // Update the instruction stream.
>> > > BB->splice(InsertPos, BB, MI);
>> > >
>> > > And splice as far as I understand moves MI to the location right
>> > > __before__ InsertPos. Our previous check made sure that InsertPos
>> !=
>> > > MI, But I do hit a case, when MI == InsertPos--, and effectively
>&...
2005 Feb 07
2
[LLVMdev] Segmentation Fault(Modifying BasicBlockPlacement.cpp)
On Mon, 7 Feb 2005, Tanu Sharma wrote:
> I have been trying to randomize blocks in a program and modified
> "BasicBlockPlacement.cpp" for the purpose but getting segmentation
> fault.I am not able to determine the problem.Can anyone please decrypt
> these error messages or suggest what might be the possible cause of
> failure?
I'd be happy to fix this, but I need