summaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfEHPrepare.cpp
Commit message (Collapse)AuthorAge
* Access the TargetLoweringInfo from the TargetMachine object instead of ↵Bill Wendling2013-06-19
| | | | | | caching it. The TLI may change between functions. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184349 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove useless code from transitioning to new EH schemeKai Nacke2013-05-31
| | | | | | | Removes all uses of the variable UsesNewEH. Simply return false in case that no resume instructions were found. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183016 91177308-0d34-0410-b5e6-96231b3b80d8
* The DWARF EH pass doesn't need the TargetMachine, only the ↵Bill Wendling2013-05-20
| | | | | | TargetLoweringBase like the other EH passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182321 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to store the TargetMachine variable in this class.Bill Wendling2013-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182317 91177308-0d34-0410-b5e6-96231b3b80d8
* Split TargetLowering into a CodeGen and a SelectionDAG part.Benjamin Kramer2013-01-11
| | | | | | | | | This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still a complete mess but as long as the edges consist of virtual call it doesn't cause breakage. BasicTTI did static calls and thus broke some build configurations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax the requirement that the exception object must be an instruction. DuringBill Wendling2012-05-17
| | | | | | | bugpoint-ing, it may turn into something else. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156998 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r149159 with a fix to add to a PHI node with a non-null parent.Bill Wendling2012-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149164 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r149159 until I can fix tests.Bill Wendling2012-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149162 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't always create a separate block for the call to _Unwind_Resume.Bill Wendling2012-01-28
| | | | | | | | | | | | Sometimes there is only one 'resume' instruction per function. In those situations, we don't need a separate block for the call to _Unwind_Resume. In fact, it adds a lot of overhead to code-gen if we do that -- especially at -O0. If we have a single 'resume' instruction, just generate the call within that block. <rdar://problem/10694814> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149159 91177308-0d34-0410-b5e6-96231b3b80d8
* When lowering the 'resume' instruction, look to see if we can eliminate theBill Wendling2012-01-20
| | | | | | | | | 'insertvalue' instructions that recreate the structure returned by the 'landingpad' instruction. Because the 'insertvalue' instruction isn't supported by FastISel, this can save a bit of time during -O0 compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148520 91177308-0d34-0410-b5e6-96231b3b80d8
* This code is dead, what with the new EH model and the auto-upgraders in place.Bill Wendling2011-11-07
| | | | | | | Delete! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144043 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the dominator tree with the correct dominator for the new 'unwind' block.Bill Wendling2011-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138664 91177308-0d34-0410-b5e6-96231b3b80d8
* Look at only the terminators of the basic block. Also, if we're using the new EHBill Wendling2011-08-25
| | | | | | | | scheme, return 'true' so that it doesn't try to run the old EH scheme's fixup on the new code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138605 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify for the new EH scheme.Bill Wendling2011-08-17
| | | | | | | | | Things are much saner now. We no longer need to modify the laning pads, because of the invariants we impose upon them. The only thing DwarfEHPrepare needs to do is convert the 'resume' instruction into a call to '_Unwind_Resume'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137855 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-30
| | | | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial code to convert ResumeInsts into calls to _Unwind_Resume.Bill Wendling2011-07-28
| | | | | | | This should be the only code necessary for DWARF EH prepare. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136387 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-12
| | | | | | StructType::get() and TargetData::getIntPtrType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
* De-constify Types in FunctionType::get().Jay Foad2011-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
* The ARM stuff already calls the Resume function, not the Resume_or_Rethrow. ItBill Wendling2011-06-01
| | | | | | | | | | | | | | turns out that it could cause an infinite loop in some situations. If this code is triggered and it converts a cleanup into a catchall, but that cleanup was in already in a cleanup, then the _Unwind_SjLj_Resume could infinite loop. I.e., the code doesn't consume the exception object and passes it on to _Unwind_SjLj_Resume. But _USjLjR expects it to be consumed (since it's landing at a catchall instead of a cleanup). So it uses the values that are presently there, which are the values that tell it to jump to the fake landing pad. <rdar://problem/9508402> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132381 91177308-0d34-0410-b5e6-96231b3b80d8
* Erase instructions _after_ checking their type.Benjamin Kramer2011-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132256 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement and document the llvm.eh.resume intrinsic, which isJohn McCall2011-05-28
| | | | | | | | | | | | | | | | | | | transformed by the inliner into a branch to the enclosing landing pad (when inlined through an invoke). If not so optimized, it is lowered DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume as appropriate). Its chief advantage is that it takes both the exception value and the selector value as arguments, meaning that there is zero effort in recovering these; however, the frontend is required to pass these down, which is not actually particularly difficult. Also document the behavior of landing pads a bit better, and make it clearer that it's okay that personality functions don't always land at landing pads. This is just a fact of life. Don't write optimizations that rely on pushing things over an unwind edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132253 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-30
| | | | | | PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
* There are some situations which can cause the URoR hack to infinitely recurseBill Wendling2011-03-15
| | | | | | | | | | | | | | and then go kablooie. The problem was that it was tracking the PHI nodes anew each time into this function. But it didn't need to. And because the recursion didn't know that a PHINode was visited before, it would go ahead and call itself. There is a testcase, but unfortunately it's too big to add. This problem will go away with the EH rewrite. <rdar://problem/8856298> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127640 91177308-0d34-0410-b5e6-96231b3b80d8
* This may be an ARM target, so check for _Unwind_SjLj_Resume.Bill Wendling2010-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117643 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply commit 112702 which was speculatively reverted by echristo.Duncan Sands2010-09-03
| | | | | | | | | | | Original commit message: Use the SSAUpdator to turn calls to eh.exception that are not in a landing pad into uses of registers rather than loads from a stack slot. Doesn't touch the 'orrible hack code - Bill needs to persuade me harder :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112952 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-01
| | | | | | | self host errors on clang-x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112719 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the SSAUpdator to turn calls to eh.exception that are not in aDuncan Sands2010-09-01
| | | | | | | | | landing pad into uses of registers rather than loads from a stack slot. Doesn't touch the 'orrible hack code - Bill needs to persuade me harder :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112702 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop using the dom frontier in DwarfEHPrepare by not promoting alloca'sDuncan Sands2010-08-31
| | | | | | | | | any more. I plan to reimplement alloca promotion using SSAUpdater later. It looks like Bill's URoR logic really always needs domtree, so the pass now always asks for domtree info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112597 91177308-0d34-0410-b5e6-96231b3b80d8
* revert 112457, it looks like it broke selfhost.Chris Lattner2010-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112459 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite DwarfEHPrepare to use SSAUpdater to promote its allocasChris Lattner2010-08-29
| | | | | | | | | instead of PromoteMemToReg. This allows it to stop using DF and DT, eliminating a computation of DT and DF from clang -O3. Clang is now down to 2 runs of DomFrontier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112457 91177308-0d34-0410-b5e6-96231b3b80d8
* inline function into its only caller.Chris Lattner2010-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112455 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Using llvm.eh.catch.all.value instead of .llvm.eh.catch.all.value.Bill Wendling2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109462 91177308-0d34-0410-b5e6-96231b3b80d8
* A block dominates itself, by definition.Dan Gohman2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109402 91177308-0d34-0410-b5e6-96231b3b80d8
* mass elimination of reliance on automatic iterator dereferencingGabor Greif2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the catch-all selectors we already found when converting them to use theBill Wendling2010-06-30
| | | | | | | | 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-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107141 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOperand APIsGabor Greif2010-06-29
| | | | 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-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107014 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOperand accessorsGabor Greif2010-06-25
| | | | | | | | | | 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-25
| | | | 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-24
| | | | | | | | | 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