search for: getcondition

Displaying 20 results from an estimated 29 matches for "getcondition".

2012 Jul 09
2
[LLVMdev] problem with visitBranchInst()
hi, my code inherits InstVisitor class, and visitBranchInst() method. 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 1...
2012 Sep 26
0
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
...>= InstID) { > Vals.push_back(VE.getTypeID(V->getType())); > return true; ... > @@ -1164,7 +1191,12 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, > Vals64.push_back(SwitchRecordHeader); > > Vals64.push_back(VE.getTypeID(SI.getCondition()->getType())); > - Vals64.push_back(VE.getValueID(SI.getCondition())); > + // ValueID for non-BB / literal operands are relative to the InstID. > + // (e.g., the condition value). > + if (EnableOldStyleFunctions) > + Vals64.push_back(VE.getValueID(SI.ge...
2010 Apr 17
2
[LLVMdev] SCEV expression for ICmpInst
...gt; 0 and A != B to A - B != 0, so the SCEV for conditions will be very simple. As there are already some functions such as "isKnownNonZero" in ScalarEvolution, so we can compute these condition easily. With the SCEV for conditions, we may write more meaningful code: SCEVEQCond *S = SE.getCondition(some_icmp_instruction); if (some_cond.isAlwaysTrue(SE)) ... do some thing ... else ... do some others thing ... Dose this make sense? or i just make things unnecessarily complex? any comment is appreciated. --best regards ether -------------- next part -------------- An HTML attachment was...
2011 Jan 03
1
[LLVMdev] Erasing dead blocks
Dear LLVM developers, I have a question regarding the IPSCCP class and the handling of dead blocks: The file lib/Transforms/Scalar/SCCP.cpp of llvm 2.8 from contains some code to deal with a dead block which could not be folded (line 1909ff). This happens when a user of this dead block is a branch or switch with an undef condition. The action taken than is to replace this terminator with an
2012 Sep 26
9
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
Hi all, I've been looking into how to make llvm bitcode files smaller. There is one simple change that appears to shrink linked bitcode files by about 15%. See this spreadsheet for some rough data: https://docs.google.com/spreadsheet/ccc?key=0AjRrJHQc4_bddEtJdjdIek5fMDdIdFFIZldZXzdWa0E The change is in how operand ids are encoded in bitcode files. Rather than use an "absolute
2010 Jun 04
5
[LLVMdev] Inserting a function call into bitcode
...)) { BranchInst *brInst = cast<BranchInst>(bi); // We are interested in conditional branch only if(brInst->isUnconditional()) continue; Value *condRes = brInst->getCondition(); errs()<<"Type:"<<condRes->getType()->getDescription()<<"\n"; // Looking for a function in Module Symbol table Constant *PrintFn = M.getOrInsertFunction("_Z12PrintCondResb", Type::getInt3...
2010 Apr 17
1
[LLVMdev] SCEV expression for ICmpInst
...the SCEV for conditions will be very simple. > > As there are already some functions such as "isKnownNonZero" in > ScalarEvolution, so we can compute these condition easily. > > With the SCEV for conditions, we may write more meaningful code: > > SCEVEQCond *S = SE.getCondition(some_icmp_instruction); > > if (some_cond.isAlwaysTrue(SE)) > ... do some thing ... > else > ... do some others thing ... > > Dose this make sense? or i just make things unnecessarily complex? > > any comment is appreciated. > > --best regards > ether
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...ute(Attribute::SanitizeMemory) && >>>> + BI->isConditional()) >>>> + return false; >>>> + >>>> Instruction *Cond = 0; >>>> if (BI->isConditional()) >>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>> =================================================================== >>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>> +++ test/Transforms/SimplifyCFG/branch-fold-msan.ll...
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...sConditional() ) { 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::UIntTy, indexBBMap[ branchInst->getSuccessor( 1 ) ] ), "select_state", basicBlock...
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...emory) && >>>>> + BI->isConditional()) >>>>> + return false; >>>>> + >>>>> Instruction *Cond = 0; >>>>> if (BI->isConditional()) >>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>> =================================================================== >>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>> +++ test/Transforms/SimplifyCFG/bran...
2012 Nov 29
2
[LLVMdev] [cfe-dev] UB in TypeLoc casting
Moving to LLVM dev to discuss the possibility of extending the cast infrastructure to handle this. On Tue, Nov 20, 2012 at 5:51 PM, John McCall <rjmccall at apple.com> wrote: > On Nov 18, 2012, at 5:05 PM, David Blaikie <dblaikie at gmail.com> wrote: >> TypeLoc casting looks bogus. >> >> TypeLoc derived types return true from classof when the dynamic type >>
2012 Nov 30
0
[LLVMdev] [cfe-dev] UB in TypeLoc casting
...ranches to swizzle the condition out to the front if (isa<BranchInst>(I) && cast<BranchInst>(I).isConditional()) { - BranchInst &BI(cast<BranchInst>(I)); + const BranchInst &BI(cast<BranchInst>(I)); Out << ' '; writeOperand(BI.getCondition(), true); Out << ", "; @@ -1769,14 +1769,14 @@ writeOperand(BI.getSuccessor(1), true); } else if (isa<SwitchInst>(I)) { - SwitchInst& SI(cast<SwitchInst>(I)); + const SwitchInst& SI(cast<SwitchInst>(I)); // Special case switch inst...
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t;>>>> + BI->isConditional()) >>>>>> + return false; >>>>>> + >>>>>> Instruction *Cond = 0; >>>>>> if (BI->isConditional()) >>>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> =================================================================== >>>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> +++ test/Transforms/...
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
2013 Nov 19
1
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t;>>>> + BI->isConditional()) >>>>>> + return false; >>>>>> + >>>>>> Instruction *Cond = 0; >>>>>> if (BI->isConditional()) >>>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> =================================================================== >>>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> +++ test/Transforms/...
2013 Nov 19
5
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...BI->isConditional()) > >>>>>> + return false; > >>>>>> + > >>>>>> Instruction *Cond = 0; > >>>>>> if (BI->isConditional()) > >>>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); > >>>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll > >>>>>> ================================================================= > >>>>>> == > >>>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll...
2010 Jun 04
0
[LLVMdev] Inserting a function call into bitcode
...rminator/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 = brInst->getCondition(); > > errs()<<"Type:"<<condRes->getType()->getDescription()<<"\n"; > > // Looking for a function in Module Symbol table > > Constant *PrintFn = M.getOrInsertFunction("_Z12PrintCondResb", > Type::getInt32Ty(context), condRes...
2010 Jun 04
0
[LLVMdev] Inserting a function call into bitcode
...          BranchInst *brInst = cast<BranchInst>(bi); > > > >                         // We are interested in conditional branch only > >                         if(brInst->isUnconditional()) continue; > > > >                         Value *condRes = brInst->getCondition(); > > > errs()<<"Type:"<<condRes->getType()->getDescription()<<"\n"; > > > >                        // Looking for a function in Module Symbol > table > >                         Constant *PrintFn = > M.getOrInsertFunctio...
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t;>>>> + BI->isConditional()) >>>>>> + return false; >>>>>> + >>>>>> Instruction *Cond = 0; >>>>>> if (BI->isConditional()) >>>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> ================================================================= >>>>>> == >>>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>&gt...
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t;>>>> + BI->isConditional()) >>>>>> + return false; >>>>>> + >>>>>> Instruction *Cond = 0; >>>>>> if (BI->isConditional()) >>>>>> Cond = dyn_cast<Instruction>(BI->getCondition()); >>>>>> Index: test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>>> ================================================================= >>>>>> == >>>>>> --- test/Transforms/SimplifyCFG/branch-fold-msan.ll >>>>&gt...