search for: branchinst

Displaying 20 results from an estimated 116 matches for "branchinst".

2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...-- a/lib/Analysis/ScalarEvolution.cpp > +++ b/lib/Analysis/ScalarEvolution.cpp > @@ -4293,9 +4293,15 @@ ScalarEvolution::ComputeExitLimit(const Loop > *L, BasicBlock *ExitingBlock) { >   // >   // FIXME: we should be able to handle switch instructions (with a > single exit) >   BranchInst *ExitBr = dyn_cast<BranchInst>(ExitingBlock->getTerminator()); > + >   if (ExitBr == 0) return getCouldNotCompute(); >   assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!"); > > +  BranchInst* BrFirstSucc = dyn_cast<BranchI...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...solution and I'm correct in my assumption? If so then I'll clean up the patch and attach a testcase for inclusion. Thanks! Marcello 2012/2/9 Nick Lewycky <nlewycky at google.com>: > Your patch should include a testcase, see test/Analysis/ScalarEvolution for > examples. "BranchInst* " should be "BranchInst *". You should have spaces > after the // in your comments. One of the comment lines isn't indented > properly. > > Nick > > On 8 February 2012 12:05, Marcello Maggioni <hayarms at gmail.com> wrote: >> >> Attached >&...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
Your patch should include a testcase, see test/Analysis/ScalarEvolution for examples. "BranchInst* " should be "BranchInst *". You should have spaces after the // in your comments. One of the comment lines isn't indented properly. Nick On 8 February 2012 12:05, Marcello Maggioni <hayarms at gmail.com> wrote: > Attached > > 2012/2/8 Marcello Maggioni <haya...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...index daf7742..fcbaffe 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -4293,6 +4293,11 @@ ScalarEvolution::ComputeExitLimit(const Loop *L, BasicBlock *ExitingBlock) { // // 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-> +...
2012 Feb 09
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...tcase in .ll format. > > Nick > >> >> Thanks! >> >> Marcello >> >> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >> > for >> > examples. "BranchInst* " should be "BranchInst *". You should have >> > spaces >> > after the // in your comments. One of the comment lines isn't indented >> > properly. >> > >> > Nick >> > >> > On 8 February 2012 12:05, Marcello Maggioni...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...index daf7742..b10fab2 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -4293,9 +4293,15 @@ ScalarEvolution::ComputeExitLimit(const Loop *L, BasicBlock *ExitingBlock) { // // FIXME: we should be able to handle switch instructions (with a single exit) BranchInst *ExitBr = dyn_cast<BranchInst>(ExitingBlock->getTerminator()); + if (ExitBr == 0) return getCouldNotCompute(); assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!"); + BranchInst* BrFirstSucc = dyn_cast<BranchInst>(ExitBr-> +...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...you gave in your email. It would really help to have a testcase in .ll format. Nick > Thanks! > > Marcello > > 2012/2/9 Nick Lewycky <nlewycky at google.com>: > > Your patch should include a testcase, see test/Analysis/ScalarEvolution > for > > examples. "BranchInst* " should be "BranchInst *". You should have spaces > > after the // in your comments. One of the comment lines isn't indented > > properly. > > > > Nick > > > > On 8 February 2012 12:05, Marcello Maggioni <hayarms at gmail.com> wrote: &g...
2012 Feb 09
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...> >>> >>> Thanks! >>> >>> Marcello >>> >>> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >>> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >>> > for >>> > examples. "BranchInst* " should be "BranchInst *". You should have >>> > spaces >>> > after the // in your comments. One of the comment lines isn't indented >>> > properly. >>> > >>> > Nick >>> > >>> > On 8 February 20...
2012 Feb 09
1
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...t; Thanks! >>>> >>>> Marcello >>>> >>>> 2012/2/9 Nick Lewycky <nlewycky at google.com>: >>>> > Your patch should include a testcase, see test/Analysis/ScalarEvolution >>>> > for >>>> > examples. "BranchInst* " should be "BranchInst *". You should have >>>> > spaces >>>> > after the // in your comments. One of the comment lines isn't indented >>>> > properly. >>>> > >>>> > Nick >>>> > >>&g...
2013 Aug 14
2
[LLVMdev] BranchInst comparison
Hi All, How could I use BranchInst to implement for example br label %if.else7 br label %if.then5 br i1 %cmp4, label %if.then5, label %if.else7 I can use BranchInst for only one instruction but how could I compare between two branches Thanks -- * Rasha Salah Omar Msc Student at E-JUST Demonestrator at Faculty...
2013 Aug 14
3
[LLVMdev] BranchInst comparison
...;rasha.sala7 at gmail.com> wrote: > or like this > > %cmp4 = icmp eq i32 %rem, 0 > > br i1 %cmp4, label %if.then5, label %if.else7 > > > On 14 August 2013 20:08, Rasha Omar <rasha.sala7 at gmail.com> wrote: > >> Hi All, >> >> How could I use BranchInst to implement for example >> br label %if.else7 >> br label %if.then5 >> br i1 %cmp4, label %if.then5, label %if.else7 >> >> I can use BranchInst for only one instruction but how could I compare >> between two branches >> >> Thanks >> >&g...
2013 Aug 15
0
[LLVMdev] BranchInst comparison
How could BranchInst be used to insert new branch between two basic blocks to get result like this example: br label %if.else br label %if.then br i1 %cmp1, label %if.then, label %if.else Thanks for your help On 14 August 2013 21:36, Eli Friedman <eli.friedman at gmail.com> wrote: > Your question isn...
2013 Aug 14
0
[LLVMdev] BranchInst comparison
or like this %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %if.then5, label %if.else7 On 14 August 2013 20:08, Rasha Omar <rasha.sala7 at gmail.com> wrote: > Hi All, > > How could I use BranchInst to implement for example > br label %if.else7 > br label %if.then5 > br i1 %cmp4, label %if.then5, label %if.else7 > > I can use BranchInst for only one instruction but how could I compare > between two branches > > Thanks > > -- > * Rasha Salah Omar >...
2010 May 20
1
[LLVMdev] crash in 2.7: SCCPSolver::ResolvedUndefsIn
...couple times now in the JIT. I've copied the failing bitcode to disk and doesn't crash opt or llc. It doesn't repro easily in the JIT either, but the stack is always the same... hoping it's a known issue. Thanks! TerminatorInst *TI = BB->getTerminator(); >>>>if (BranchInst *BI = dyn_cast<BranchInst>(TI)) { if (!BI->isConditional()) continue; #0 llvm::Value::getValueID (this=0xfffffd7fecbef3c0, F=<value optimized out>) at ./llvm-2.7/include/llvm/Value.h:247 #1 llvm::Instruction::getOpcode (this=0xfffffd7fecbef3c0, F=<value optimized out>)...
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...uctions that allocate and initialize the dispatcher's state variable // to the initialization block. AllocaInst* statePtr = new AllocaInst( Type::UIntTy, 0, "state", disInitBB ); new StoreInst( ConstantUInt::get( Type::UIntTy, firstBBIndex ), statePtr, disInitBB ); new BranchInst( disMainBB, disInitBB ); // Connection to the dispatcher's main block. // Add instructions to the dispatcher's main block that implement switching // between the basic blocks depending on the state variable's value. LoadInst* loadState = new LoadInst( statePtr, "nex...
2015 Jul 24
2
[LLVMdev] Transforming SwitchInst to BranchInst
Hi, Are there some built-in LLVM transformation pass, or written library code that transforms LLVM::SwitchInst into if-condition statements (LLVM:: BranchInst)? The purpose of the transformation is that we have a legacy program analyzer that includes an LLVM pass manipulating if-condition statements. Statements of LLVM::SwithchInst should have been handled in the same manner but was not done. Thus to transform these SwitchInst to if-condition looks a vi...
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));...
2004 Dec 07
1
[LLVMdev] Question adding dummy basic blocks
...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 value of PHINODE, and trying to find some examples to solve, but we failed // Since the DestBB is added to one more predecessor, and we...
2010 Jun 04
5
[LLVMdev] Inserting a function call into bitcode
...for(Function::iterator fi = mi->begin(), fe = mi->end(); fi!=fe; fi++) { BasicBlock::iterator bi = fi->end(); bi--; // Getting the terminator/last instruction of BasicBlock if(isa<BranchInst>(bi)) { BranchInst *brInst = cast<BranchInst>(bi); // We are interested in conditional branch only if(brInst->isUnconditional()) continue; Value *condRes = brIn...
2004 Jun 08
0
[LLVMdev] BranchInst problem
On Tue, 8 Jun 2004, Vladimir Prus wrote: > While adding support for branch instructions in my backend, I run into a > trouble. The code to handle branches looks like: > The machine code after instruction selection is: > > entry (0x8681458): > %reg1024 = load <fi#-1> > %reg1025 = load <fi#-2> > setcc %reg1024, %reg1025 >