Displaying 20 results from an estimated 31 matches for "getsuccessor".
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...);
> +
> if (ExitBr == 0) return getCouldNotCompute();
> assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!");
>
> + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
> + getSuccessor(0)->getTerminator());
> + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
> + getSuccessor(1)->getTerminator());
> +
> // At this point, we know we have a conditional branch that
> determines whether
> // the...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...tingBlock) {
//
// FIXME: we should be able to handle switch instructions (with a
single exit)
BranchInst *ExitBr = dyn_cast<BranchInst>(ExitingBlock->getTerminator());
+ BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
+ getSuccessor(0)->getTerminator());
+ BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
+ getSuccessor(1)->getTerminator());
+
if (ExitBr == 0) return getCouldNotCompute();
assert(ExitBr->isConditional() && "If unconditional,...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...ngBlock->getTerminator());
+
if (ExitBr == 0) return getCouldNotCompute();
assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!");
+ BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
+ getSuccessor(0)->getTerminator());
+ BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
+ getSuccessor(1)->getTerminator());
+
// At this point, we know we have a conditional branch that
determines whether
// the loop is exited. However, we...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...xitBr == 0) return getCouldNotCompute();
>> > assert(ExitBr->isConditional() && "If unconditional, it can't be in
>> > loop!");
>> >
>> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
>> > +
>> > getSuccessor(0)->getTerminator());
>> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
>> > +
>> > getSuccessor(1)->getTerminator());
>> > +
>> > // At this point, we know we have a conditional branch that
>> > determines wheth...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...());
> > +
> > if (ExitBr == 0) return getCouldNotCompute();
> > assert(ExitBr->isConditional() && "If unconditional, it can't be in
> loop!");
> >
> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
> > +
> getSuccessor(0)->getTerminator());
> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
> > +
> getSuccessor(1)->getTerminator());
> > +
> > // At this point, we know we have a conditional branch that
> > determines whether
> > // the loop is...
2012 Feb 09
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...> > assert(ExitBr->isConditional() && "If unconditional, it can't be in
>> >> > loop!");
>> >> >
>> >> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
>> >> > +
>> >> > getSuccessor(0)->getTerminator());
>> >> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
>> >> > +
>> >> > getSuccessor(1)->getTerminator());
>> >> > +
>> >> > // At this point, we know we have a condition...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...Compute();
> >> > assert(ExitBr->isConditional() && "If unconditional, it can't be in
> >> > loop!");
> >> >
> >> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
> >> > +
> >> > getSuccessor(0)->getTerminator());
> >> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
> >> > +
> >> > getSuccessor(1)->getTerminator());
> >> > +
> >> > // At this point, we know we have a conditional branch that
>...
2012 Feb 09
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...xitBr->isConditional() && "If unconditional, it can't be in
>>> >> > loop!");
>>> >> >
>>> >> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
>>> >> > +
>>> >> > getSuccessor(0)->getTerminator());
>>> >> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
>>> >> > +
>>> >> > getSuccessor(1)->getTerminator());
>>> >> > +
>>> >> > // At this point, we know...
2012 Feb 09
1
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...nal() && "If unconditional, it can't be in
>>>> >> > loop!");
>>>> >> >
>>>> >> > + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr->
>>>> >> > +
>>>> >> > getSuccessor(0)->getTerminator());
>>>> >> > + BranchInst* BrSecondSucc = dyn_cast<BranchInst>(ExitBr->
>>>> >> > +
>>>> >> > getSuccessor(1)->getTerminator());
>>>> >> > +
>>>> >> > // At...
2012 May 21
2
[LLVMdev] VMKit build broken
...vmkit and checked out the source
from the svn repo a few minutes back. The build is failing with the
following error.
llvm[4]: Compiling CGCleanup.cpp for Release+Asserts build
CGCleanup.cpp:507:36: error: no member named 'getCaseSuccessor' in
'llvm::SwitchInst'; did you mean 'getSuccessor'?
llvm::BranchInst::Create(si->getCaseSuccessor(0), si);
^~~~~~~~~~~~~~~~
getSuccessor
/home/ganapathy/projects/llvm/include/llvm/Instructions.h:2727:15:
note: 'getSuccessor' declared here
BasicBlock *getSu...
2012 May 22
0
[LLVMdev] VMKit build broken
...urce
> from the svn repo a few minutes back. The build is failing with the
> following error.
>
> llvm[4]: Compiling CGCleanup.cpp for Release+Asserts build
> CGCleanup.cpp:507:36: error: no member named 'getCaseSuccessor' in
> 'llvm::SwitchInst'; did you mean 'getSuccessor'?
> llvm::BranchInst::Create(si->getCaseSuccessor(0), si);
> ^~~~~~~~~~~~~~~~
> getSuccessor
> /home/ganapathy/projects/llvm/include/llvm/Instructions.h:2727:15:
> note: 'getSuccessor' declared he...
2004 Jun 08
2
[LLVMdev] BranchInst problem
While adding support for branch instructions in my backend, I run into a
trouble. The code to handle branches looks like:
void visitBranchInst(BranchInst& BI)
{
BB->addSuccessor (MBBMap[BI.getSuccessor(0)]);
if (BI.isConditional())
BB->addSuccessor (MBBMap[BI.getSuccessor(1)]);
...........
BuildMI(BB, NM::GOTO, 1).addPCDisp(BI.getSuccessor(0));
BuildMI(BB, NM::GOTO, 1).addPCDisp(BI.getSuccessor(1));...
2013 Jul 31
1
[LLVMdev] Problem to remove successors
...cNum < TI->getNumSuccessors() &&
"Trying to remove a nonexistant successor!");
// If our old successor block contains any PHI nodes, remove the entry
in the
// PHI nodes that comes from this branch...
//
BasicBlock *BB = TI->getParent();
TI->getSuccessor(SuccNum)->removePredecessor(BB);
TerminatorInst *NewTI = 0;
switch (TI->getOpcode()) {
case Instruction::Br:
// If this is a conditional branch... convert to unconditional branch.
if (TI->getNumSuccessors() == 2) {
cast<BranchInst>(TI)->setUnconditiona...
2012 Jul 09
2
[LLVMdev] problem with visitBranchInst()
...however, i notice that inside the virtual method
visitBranchInst(BranchInst &I), on the LLVM instruction like:
br i1 %1, label %2, label %3
my code doesnt return expected info. for ex, the code
I.getCondition->getName().str()
would return empty string. and at the same time, the code
I.getSuccessor(0)->getName()
would also return emtpy string.
i am pretty confused, as i am expecting non-empty strings returned
from the above functions.
any idea on why this happens?
this is on LLVM 3.0, Ubuntu 12.04.
thanks so much,
Jun
2004 Aug 27
1
[LLVMdev] Help getting condition of branch instructions in pass
Hi, this is a bit of a newbie question:
I am trying to discover, given a block with a conditional and its
successors, which condition (T/F) each successor applies to.
There's almost identical code in CFGPrinter.cpp, but where it gets
called in GraphWriter.h, the child_iterator type is a pretty hairy
thing, so I still don't quite understand how to get one from a
BasicBlock in my own
2019 Oct 23
2
Inserting instructions when encountered a specific label
Hello,
I’m trying to insert an instruction if a specific label name/string is encountered and would appreciate some guidance on where I should start. Basically when parsing going through this .ll file:
; Function Attrs: noinline nounwind optnone uwtable
define i32 @main(i32, i8**) #0 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
%5 = alloca i8**, align 8
%6 = alloca i32, align
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...( terminator );
// Add instruction selecting a proper basic block's index.
Value* stateValue = 0;
if( !branchInst->isConditional() )
{
stateValue = ConstantUInt::get(
Type::UIntTy,
indexBBMap[ branchInst->getSuccessor( 0 ) ]
);
}
else
{
stateValue = new SelectInst(
branchInst->getCondition(),
ConstantUInt::get( Type::UIntTy, indexBBMap[
branchInst->getSuccessor( 0 ) ] ),
ConstantUInt::get( Type::...
2004 Dec 07
1
[LLVMdev] Question adding dummy basic blocks
...erate a new basic block and unconditional branch which is from C to B.
Finally, We got some problems due to PHINODE. I knew the reason, but I failed to fix it.
The code is like the following
if( TI->getNumSuccessors() ==1){
BasicBlock *TIBB=TI->getParent();
BasicBlock *DestBB=TI->getSuccessor(0);
BasicBlock *NewBB = new BasicBlock(TIBB->getName()+DestBB->getName()+"dummy_bb",&F);
new BranchInst(DestBB, NewBB);
BranchInst *NewBr = new BranchInst(DestBB, NewBB, V_dummy);
ReplaceInstWithInst(TI, NewBr);
// the following code, we are trying to change va...
2019 Oct 23
3
Inserting instructions when encountered a specific label
Hi Tim,
Thank you for the quick response!
so you'd probably check you're looking at a
BranchInst and check BI->getSuccessor(0)->getName() (& 1 if it's
conditional)
I initially was printing out the result from getName() (I.getParent()->getName()) and it printed out nothing sadly.
when parsing the instructions in SelectionDAGBuilder but it was only visiting instructions in the first/main BB and outputted %2...
2018 Aug 30
4
crash problem when using IndirectBrInst to replace BranchInst
...lowing:
br i1 %1, label %2, label %3
And the transformed IR is as the follwoing:
%4 = select i1 %1, i8* blockaddress(@func, %2), i8* blockaddress(@func,
%3)
indirectbr i8* %4, [label %2, label %3]
The pass's core function is as the following:
BasicBlock *TrueDest = BI->getSuccessor(0);//BI is a conditional
branch
BasicBlock *FalseDest = BI->getSuccessor(1);
BlockAddress * TrueDestAddr = BlockAddress::get(TrueDest);
BlockAddress * FalseDestAddr = BlockAddress::get(FalseDest);
Value * ConditionValue = BI->getCondition();
SelectInst...