search for: unreachableinst

Displaying 18 results from an estimated 18 matches for "unreachableinst".

2010 May 15
0
[LLVMdev] [cfe-dev] Question about UnreachableInst and exit() system call
Hi Chris, Thanks for the reply. Right now, I disabled the doesNotReturn() check in the code for emitting calls in clang (CGCall) and also disabled running simplifycfg/prune-eh passes that introduce UnreachableInst after exit(). The main issue is that the particular transform pass that I am using in our backend does not yet support multiple loop exits and common case where this issue arises is when there are exit() calls inside the loop. With the above change, -loopsimplify is able to transform all loops (th...
2010 Jun 05
1
[LLVMdev] Why UnreachableInst instruction is required when the last call has NoReturn flag?
Looks like these two things duplicate each other. Yuri
2019 Jun 04
2
is this a bug in PruneEH?
...PruneEH pass uses SimplifyFunction() which contains this code: for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) if (CallInst *CI = dyn_cast<CallInst>(I++)) if (CI->doesNotReturn() && !CI->isMustTailCall() && !isa<UnreachableInst>(I)) { // This call calls a function that cannot return. Insert an // unreachable instruction after it and simplify the code. Do this // by splitting the BB, adding the unreachable, then deleting the // new BB. BasicBlock *New = BB->splitBas...
2013 Jul 18
0
[LLVMdev] About LLVM switch instruction
...get block. > I could potentially fake that edge to be one of the other case label > targets, but that is an ugly hack and I don't want to do that. > I would appreciate if you can suggest better alternatives. Hi Milind, If you make the "default" branch to a block that has an UnreachableInst as a terminator, the SimplifyCFG pass will remove one of the switch cases and replace the block that the default branches to with the block that this removed case branches to. This sounds a lot like the "ugly hack" that you would like to avoid. Would it be a reasonable solution for what y...
2013 Jul 18
2
[LLVMdev] About LLVM switch instruction
I am performing a transformation that requires changing the targets of a basic block ending with a switch instruction. In particular, I need to delete the edge that goes to the "default" basic block. But, LLVM switch instruction always wants a default target basic block for a switch instruction. It is not clear how to accomplish this, since I don't have a replacement default target
2013 Jul 18
4
[LLVMdev] About LLVM switch instruction
...tentially fake that edge to be one of the other case label >> targets, but that is an ugly hack and I don't want to do that. >> I would appreciate if you can suggest better alternatives. > > Hi Milind, > > If you make the "default" branch to a block that has an UnreachableInst as a terminator, the SimplifyCFG pass will remove one of the switch cases and replace the block that the default branches to with the block that this removed case branches to. This sounds a lot like the "ugly hack" that you would like to avoid. Would it be a reasonable solution for what y...
2013 Jul 18
0
[LLVMdev] About LLVM switch instruction
...one of the other case label > >> targets, but that is an ugly hack and I don't want to do that. > >> I would appreciate if you can suggest better alternatives. > > > > Hi Milind, > > > > If you make the "default" branch to a block that has an UnreachableInst > as a terminator, the SimplifyCFG pass will remove one of the switch cases > and replace the block that the default branches to with the block that this > removed case branches to. This sounds a lot like the "ugly hack" that you > would like to avoid. Would it be a reasonable...
2013 Jul 18
2
[LLVMdev] About LLVM switch instruction
...abel >> >> targets, but that is an ugly hack and I don't want to do that. >> >> I would appreciate if you can suggest better alternatives. >> > >> > Hi Milind, >> > >> > If you make the "default" branch to a block that has an UnreachableInst >> > as a terminator, the SimplifyCFG pass will remove one of the switch cases >> > and replace the block that the default branches to with the block that this >> > removed case branches to. This sounds a lot like the "ugly hack" that you >> > would lik...
2012 May 20
1
[LLVMdev] Error While Inserting New Instruction to LLVM IR
....def:104:1: error: ‘visitXXX’ was not declared in this scope* */home/arnie/llvm-svn/llvm/include/llvm/Instruction.def:105:1: error: ‘visitYYY’ was not declared in this scope* But part of my Instruction.def looks like this (after inserting XXX and YYY)- . ....... HANDLE_TERM_INST ( 7, Unreachable, UnreachableInst) HANDLE_TERM_INST ( 8, XXX , XXXInst) HANDLE_TERM_INST ( 9, YYY , YYYInst) LAST_TERM_INST ( 9) ....... Can anybody guess what may be the reason of this error? Did I miss any files that need to be modified. Below are the list of files I modified to add new LLVM IR instruction. llvm/i...
2013 Jul 18
0
[LLVMdev] About LLVM switch instruction
..., but that is an ugly hack and I don't want to do that. > >> >> I would appreciate if you can suggest better alternatives. > >> > > >> > Hi Milind, > >> > > >> > If you make the "default" branch to a block that has an > UnreachableInst > >> > as a terminator, the SimplifyCFG pass will remove one of the switch > cases > >> > and replace the block that the default branches to with the block > that this > >> > removed case branches to. This sounds a lot like the "ugly hack" that &g...
2007 Apr 06
1
[LLVMdev] Integrating LLVM in an existing project
...that :-/ The attached patch helps a bit but it needs more work. Also, I suppose you might need to uncomment this bit in llvm-backend.cpp as well: // Disabled until PR1224 is resolved. //if (flag_exceptions) // Args.push_back("--enable-eh"); Some comments on the patch: (1) new UnreachableInst(CurBB); + } else { + new UnwindInst(UnwindBB); } -#endif +#else new UnwindInst(UnwindBB); +#endif This avoid generating an unwind instruction straight after an unreachable instruction, i.e. two terminators in a row. (2) - FuncCPPPersonality = cast<Function>( + FuncCPPPe...
2007 Apr 06
0
[LLVMdev] Integrating LLVM in an existing project
On Fri, 6 Apr 2007, Nicolas Geoffray wrote: > Like you say, it's not functional for non-calls instructions. Besides, > having to change all CalInst to InvokeInst is just too much pain in our > current vm. ok. > Actually, why is it missing? What's the difference between the code > generator and the JIT? There are two things missing: 1. Testing and working out the set
2011 Sep 01
1
[LLVMdev] How to halt a program
...;M); // Call to abort function CallInst *abort = CallInst::Create(AbortF, Twine(), assertfail); // Add atributes to the abort call instruction: no return and no unwind abort->addAttribute(~0, Attribute::NoReturn); abort->addAttribute(~0, Attribute::NoUnwind); // Unreachable instruction new UnreachableInst(*context, assertfail); So, my bytecode now looks like this one below: define i32 @main() nounwind { .... "assert fail": ; preds = %bb1, %13, %bb, %3, %entry call void @abort() noreturn nounwind unreachable .... } define void @abort() { "asser...
2011 Aug 19
0
[LLVMdev] How to halt a program
Victor Campos wrote: > Guys, > > I would like to instrument the bytecode that LLVM produces with > assertions. I have written the instrumentation code manually, but I do > not know how to halt the program in case the assertion is false. I took > a look into the bytecode that LLVM produces for a program like: > > #include <stdlib.h> > int main() { >
2007 Apr 06
2
[LLVMdev] Integrating LLVM in an existing project
Hi Chris, Chris Lattner wrote: >> We can not use current exception handling in llvm, see >> http://www.nondot.org/sabre/LLVMNotes/ExceptionHandlingChanges.txt. >> > > Why not? > > Like you say, it's not functional for non-calls instructions. Besides, having to change all CalInst to InvokeInst is just too much pain in our current vm. > There are two
2011 Aug 19
2
[LLVMdev] How to halt a program
Guys, I would like to instrument the bytecode that LLVM produces with assertions. I have written the instrumentation code manually, but I do not know how to halt the program in case the assertion is false. I took a look into the bytecode that LLVM produces for a program like: #include <stdlib.h> int main() { exit(1); } And it is like this: define i32 @main() nounwind { entry:
2005 May 11
3
[LLVMdev] Question About inserting Instruction?
Hi, I am working on a project with LLVM. What I need to do is to generate/insert some dummy/dead basic blocls which never have chance to be executed and put some instructions in those dummy/dead basic blocks. So far, the dummy/dead BB insertion is done. I am trying insert instructions in those dummy/dead BB. Actually, I can insert the legal instructions to dummy/dead BB, however, I really want
2011 Apr 05
3
[LLVMdev] Building LLVM on Solaris/Sparc
...cts/tools/opt/Debug+Asserts/GraphPrinters.o llvm::createUnifyFunctionExitNodesPass() /n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/opt.o llvm::createArgumentPromotionPass(unsigned int)/n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/opt.o llvm::UnreachableInst::UnreachableInst(llvm::LLVMContext&, llvm::Instruction*)/n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/opt.o llvm::CallGraph::ID /n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/AnalysisWrappers.o llvm::createFunctionAttrsPass() /n/fs/scratc...