aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/DwarfEHPrepare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use the catch-all selectors we already found when converting them to use theBill Wendling2010-06-301-16/+23
| | | | | | | | correct catch-all value. This saves having to iterate through all of the selectors in the program again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107345 91177308-0d34-0410-b5e6-96231b3b80d8
* It seems clear that this should return Changed.Duncan Sands2010-06-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107141 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOperand APIsGabor Greif2010-06-291-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107132 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify: we have solid argument iterator rangeGabor Greif2010-06-281-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107014 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOperand accessorsGabor Greif2010-06-251-9/+14
| | | | | | | | | | and CallInst for getting hold of the intrinsic's arguments simplify along the way (at least for me this is much more legible now) Bill, Baldrick or Anton, please review\! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106838 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOperand API (the simple part)Gabor Greif2010-06-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106837 91177308-0d34-0410-b5e6-96231b3b80d8
* Loosen up the requirements in the Horrible Hack(tm) to include all selectorsBill Wendling2010-06-241-30/+10
| | | | | | | | | which don't have a catch-all associated with them not just clean-ups. This fixes the SingleSource/Benchmarks/Shootout-C++/except.cpp testcase that broke because of my change r105902. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106772 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unnecessary uses of getZExtValue().Dan Gohman2010-06-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106279 91177308-0d34-0410-b5e6-96231b3b80d8
* When performing the Horrible Hack(tm-Duncan) on the EH code to convert aBill Wendling2010-06-121-26/+49
| | | | | | | | | clean-up to a catch-all after inlining, take into account that there could be filter IDs as well. The presence of filters don't mean that the selector catches anything. It's just metadata information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105872 91177308-0d34-0410-b5e6-96231b3b80d8
* Code that needs a TargetMachine should have access to one directly, ratherDan Gohman2010-04-191-5/+7
| | | | | | | than just getting one through a TargetLowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101802 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-5/+5
| | | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r101434Gabor Greif2010-04-161-5/+5
| | | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-151-5/+5
| | | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
* typosGabor Greif2010-04-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101371 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-151-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-151-5/+5
| | | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip debug info when looking for existing EH calls at theDale Johannesen2010-04-021-2/+2
| | | | | | | | beginning of a block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100230 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add back in the slow way of determining of a clean-up should become aBill Wendling2010-03-291-0/+135
| | | | | | | | catch-all. The "dominates" way won't catch all of the selectors which must be changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99850 91177308-0d34-0410-b5e6-96231b3b80d8
* A more general (and simpler!) implementation of r99671. It performs a similarBill Wendling2010-03-291-122/+59
| | | | | | | | | | | | transform. I.e., if a clean-up eh.selector call dominates the invoke of an _Unwind_Resume_or_Rethrow, then we convert the eh.selector into a catch-all. This patch, however, uses the DominatorTree information, and doesn't go through the whole rigmarole of starting at the eh.exception call, finding the corresponding URoR and eh.selector calls, and trying to trace through any number of instruction types to get to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99846 91177308-0d34-0410-b5e6-96231b3b80d8
* Return if we changed anything or not.Bill Wendling2010-03-271-11/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99695 91177308-0d34-0410-b5e6-96231b3b80d8
* If a selector has a call to ".llvm.eh.catch.all.value" that we haven'tBill Wendling2010-03-271-8/+38
| | | | | | | converted, then use the initializer, since using the name itself won't work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99692 91177308-0d34-0410-b5e6-96231b3b80d8
* If we mark clean-ups as clean-ups, then it could break when inlining through anBill Wendling2010-03-261-7/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | 'invoke' instruction. You will get a situation like this: bb: %ehptr = eh.exception() %sel = eh.selector(%ehptr, @per, 0); ... bb2: invoke _Unwind_Resume_or_Rethrow(%ehptr) %normal unwind to %lpad lpad: ... The unwinder will see the %sel call as a clean-up and, if it doesn't have a catch further up the call stack, it will skip running it. But there *is* another catch up the stack -- the catch for the %lpad. However, we can't see that. This is fixed in code-gen, where we detect this situation, and convert the "clean-up" selector call into a "catch-all" selector call. This gives us the correct semantics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99671 91177308-0d34-0410-b5e6-96231b3b80d8
* SjLj EH introduces can introduce an additional edge to a landing pad and padJim Grosbach2010-01-201-0/+13
| | | | | | normalization needs to take this into account. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94046 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull LLVMContext out of PromoteMemToReg.Nick Lewycky2009-11-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89645 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't put in these EH changes.Bill Wendling2009-10-291-291/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85460 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r85338 for now. It's causing a bootstrap failure on PPC darwin9.Bill Wendling2009-10-291-35/+291
| | | | | | | | | | --- Reverse-merging r85338 into '.': U lib/CodeGen/SimpleRegisterCoalescing.cpp U lib/CodeGen/SimpleRegisterCoalescing.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85454 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | | VISIBILITY_HIDDEN removal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-061-1/+1
| | | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand on comment.Eric Christopher2009-09-151-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81928 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull the creation of the "RewindFunction" function out of the loop. It's onlyBill Wendling2009-09-141-14/+25
| | | | | | | | created once, so shouldn't be stuck in the middle of the loop. Also early exit if there are no uses of UnwindInst in the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81785 91177308-0d34-0410-b5e6-96231b3b80d8
* If there's a calling convention attach it to the rewind function call.Eric Christopher2009-09-041-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80976 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-151-2/+2
| | | | | | AllocaInst and MallocInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
* More LLVMContext-ification.Owen Anderson2009-07-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74807 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new codegen pass that normalizes dwarf exception handlingDuncan Sands2009-05-221-0/+397
code in preparation for code generation. The main thing it does is handle the case when eh.exception calls (and, in a future patch, eh.selector calls) are far away from landing pads. Right now in practice you only find eh.exception calls close to landing pads: either in a landing pad (the common case) or in a landing pad successor, due to loop passes shifting them about. However future exception handling improvements will result in calls far from landing pads: (1) Inlining of rewinds. Consider the following case: In function @f: ... invoke @g to label %normal unwind label %unwinds ... unwinds: %ex = call i8* @llvm.eh.exception() ... In function @g: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... "rethrow exception" Now inline @g into @f. Currently this is turned into: In function @f: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... invoke "rethrow exception" to label %normal unwind label %unwinds unwinds: %ex = call i8* @llvm.eh.exception() ... However we would like to simplify invoke of "rethrow exception" into a branch to the %unwinds label. Then %unwinds is no longer a landing pad, and the eh.exception call there is then far away from any landing pads. (2) Using the unwind instruction for cleanups. It would be nice to have codegen handle the following case: invoke @something to label %continue unwind label %run_cleanups ... handler: ... perform cleanups ... unwind This requires turning "unwind" into a library call, which necessarily takes a pointer to the exception as an argument (this patch also does this unwind lowering). But that means you are using eh.exception again far from a landing pad. (3) Bugpoint simplifications. When bugpoint is simplifying exception handling code it often generates eh.exception calls far from a landing pad, which then causes codegen to assert. Bugpoint then latches on to this assertion and loses sight of the original problem. Note that it is currently rare for this pass to actually do anything. And in fact it normally shouldn't do anything at all given the code coming out of llvm-gcc! But it does fire a few times in the testsuite. As far as I can see this is almost always due to the LoopStrengthReduce codegen pass introducing pointless loop preheader blocks which are landing pads and only contain a branch to another block. This other block contains an eh.exception call. So probably by tweaking LoopStrengthReduce a bit this can be avoided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8