summaryrefslogtreecommitdiff
path: root/lib/VMCore
Commit message (Collapse)AuthorAge
* Add a check to make sure schedulePass() has not deleted stale RequiredPass.Devang Patel2011-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139642 91177308-0d34-0410-b5e6-96231b3b80d8
* Add codegen support for vector select (in the IR this means a selectDuncan Sands2011-09-06
| | | | | | | | | | | | | with a vector condition); such selects become VSELECT codegen nodes. This patch also removes VSETCC codegen nodes, unifying them with SETCC nodes (codegen was actually often using SETCC for vector SETCC already). This ensures that various DAG combiner optimizations kick in for vector comparisons. Passes dragonegg bootstrap with no testsuite regressions (nightly testsuite as well as "make check-all"). Patch mostly by Nadav Rotem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139159 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-06
| | | | | | | | | | | | | | | | | | | | | init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
* The insertion point for the loads is right before the llvm.eh.exceptionBill Wendling2011-09-04
| | | | | | | | | call. The call may be in the same BB as the landingpad instruction. If that's the case, then inserting the loads after the landingpad inst, but before the extractvalues, causes undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139088 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't reload the values that are already there. The llvm.eh.resume uses the sameBill Wendling2011-09-03
| | | | | | | | values that the resume instruction uses. PR10850 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139076 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to get fancy inserting a PHI node when the values are stored in stackBill Wendling2011-09-02
| | | | | | | | | slots. This fixes a bug where the number of nodes coming into the PHI node may not equal the number of predecessors. E.g., two or more landingpad instructions may require a PHI before reaching the eh.exception and eh.selector instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139035 91177308-0d34-0410-b5e6-96231b3b80d8
* Return undef value (instead of arbitrary) for wrong or undef index inJakub Staszak2011-09-02
| | | | | | | ConstantVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139007 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantVector returns arbitrary value for the wrong index.Jakub Staszak2011-09-02
| | | | | | | This fixes PR10813. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139006 91177308-0d34-0410-b5e6-96231b3b80d8
* Perform the upgrading of the old EH to the new EH in a more sane manner.Bill Wendling2011-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | Perform the upgrading in steps. * First, create a map of the invokes to the EH intrinsics. * Next, take that mapping and determine if the invoke's unwind destination has a single predecessor. If not, then create a new empty block to hold the new landingpad instruction. * Create a landingpad instruction into the uwnind destination. Fill it with the values from the old selector. Map the old intrinsic calls to the new landingpad values (there may be multiple landingpad instructions per instrinic call pairs). * Go through the old intrinsic calls, create a PHI node when necessary, and then replace their values with the new values from the landingpad instructions. * Delete all dead instructions. * ??? * Profit! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138990 91177308-0d34-0410-b5e6-96231b3b80d8
* Make isSafeToSpeculativelyExecute() return the right answer for some new ↵Eli Friedman2011-09-01
| | | | | | instructions. Found by inspection; not sure what practical impact, if any, this has. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138962 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes following the CR by Chris and Duncan:Nadav Rotem2011-08-29
| | | | | | | | | Optimize chained bitcasts of the form A->B->A. Undo r138722 and change isEliminableCastPair to allow this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138756 91177308-0d34-0410-b5e6-96231b3b80d8
* Dump with dbgs() instead of printf.Benjamin Kramer2011-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138749 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GCC happy by adding parens.Benjamin Kramer2011-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138748 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r138695. Fix PassManager stack depths.Andrew Trick2011-08-29
| | | | | | | Patch by Xiaoyi Guo! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138737 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r138695 to see if it fixes clang self host.Andrew Trick2011-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138701 91177308-0d34-0410-b5e6-96231b3b80d8
* Only delete instructions once.Bill Wendling2011-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138700 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PassManager stack depths.Andrew Trick2011-08-27
| | | | | | | Patch by Xiaoyi Guo! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138695 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial check in that will auto-upgrade the old EH scheme to the new EH scheme.Bill Wendling2011-08-25
| | | | | | | | | | | This upgrade suffers from the problems of the old EH scheme - i.e., that the calls to llvm.eh.exception() and llvm.eh.selector() can wander off and get lost. It makes a valiant effort to reclaim these little lost lambs. This is a first draft, so it hasn't yet been hooked up to the parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138602 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.Nadav Rotem2011-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138469 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some useful accessors to c++ api that appear to be missing from the c apiNate Begeman2011-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138371 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Address Duncan's CR request:"Eric Christopher2011-08-23
| | | | | | | | | | This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340) Conflicts: test/Transforms/InstCombine/bitcast.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138366 91177308-0d34-0410-b5e6-96231b3b80d8
* Address Duncan's CR request:Nadav Rotem2011-08-23
| | | | | | | | | | | 1. Cleanup the tests in ConstantFolding.cpp 2. Implement isAllOnes for Constant, ConstantFP, ConstantVector git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138340 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip out the old StructType APIs as warned about on llvmdev last week.Chris Lattner2011-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137953 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r137655. There is some question about whether the 'landingpad'Bill Wendling2011-08-17
| | | | | | | instruction should be marked as potentially reading and/or writing memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137863 91177308-0d34-0410-b5e6-96231b3b80d8
* The resume instruction may throw. Return 'true' in this case.Bill Wendling2011-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137757 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getFirstInsertionPt() method.Bill Wendling2011-08-16
| | | | | | | | | getFirstInsertionPt() returns an iterator to the first insertion point in a basic block. This is after all PHIs and any other instruction which is required to be at the top of the basic block (like LandingPadInst). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137744 91177308-0d34-0410-b5e6-96231b3b80d8
* Duncan pointed out that the LandingPadInst might read memory. (It might alsoBill Wendling2011-08-15
| | | | | | | write to memory.) Marking it as such makes some checks for immobility go away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137655 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix predicates methods on Instruction to handle atomic load/store correctly.Eli Friedman2011-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137652 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last improper use of getGlobalContext() from LLVM.Nick Lewycky2011-08-13
| | | | | | | | | | | | | This caused a race condition where a thread calls ~LLVMContextImpl which calls Module::dropAllReferences which calls begin() on an empty ilist that would create the sentinel, which racily accesses the global context. This can not be fixed by locking inside createSentinel because the lock would need to be shared with all users of the global context, including those that reside outside LLVM's own code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137546 91177308-0d34-0410-b5e6-96231b3b80d8
* Move "atomic" and "volatile" designations on instructions after the opcodeEli Friedman2011-08-12
| | | | | | | | | | | | of the instruction. Note that this change affects the existing non-atomic load and store instructions; the parser now accepts both forms, and the change is noted in the release notes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137527 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-12
| | | | | | | | | | | | | This implements the 'landingpad' instruction. It's used to indicate that a basic block is a landing pad. There are several restrictions on its use (see LangRef.html for more detail). These restrictions allow the exception handling code to gather the information it needs in a much more sane way. This patch has the definition, implementation, C interface, parsing, and bitcode support in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137501 91177308-0d34-0410-b5e6-96231b3b80d8
* add ifdef's to let people easily remove these dead api for testing.Chris Lattner2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137483 91177308-0d34-0410-b5e6-96231b3b80d8
* switch to the new struct apis.Chris Lattner2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137481 91177308-0d34-0410-b5e6-96231b3b80d8
* forward to the correct constructor.Chris Lattner2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137479 91177308-0d34-0410-b5e6-96231b3b80d8
* add two missing function implsChris Lattner2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137470 91177308-0d34-0410-b5e6-96231b3b80d8
* add new accessors to reflect new terminology in struct types.Chris Lattner2011-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137468 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.Eli Friedman2011-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137226 91177308-0d34-0410-b5e6-96231b3b80d8
* VMCore/BasicBlock.cpp: Don't assume BasicBlock::iterator might end with a ↵NAKAMURA Takumi2011-08-09
| | | | | | | | | | non-PHInode Instruction in successors. Frontends(eg. clang) might pass incomplete form of IR, to step off the way beyond iterator end. In the case I had met, it took infinite loop due to meeting bogus PHInode. Thanks to Jay Foad and John McCall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137175 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix whitespace.NAKAMURA Takumi2011-08-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137174 91177308-0d34-0410-b5e6-96231b3b80d8
* Representation of 'atomic load' and 'atomic store' in IR.Eli Friedman2011-08-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137170 91177308-0d34-0410-b5e6-96231b3b80d8
* Indicate that there are changes if runOfFunction returns saying that there are.Bill Wendling2011-08-08
| | | | | | | Patch by Jingyue! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137072 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary space.Bill Wendling2011-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137041 91177308-0d34-0410-b5e6-96231b3b80d8
* strengthen up an assertion: you can't create a constant structChris Lattner2011-08-07
| | | | | | | | with an opaque struct type, it doesn't make sense. This should resolve PR10473. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137028 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR10286, a problem with the .ll printer handling block addresses that ↵Chris Lattner2011-08-03
| | | | | | are out-of-scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136768 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the LLVMBuildUnwind C API function.Bill Wendling2011-08-02
| | | | | | | | The 'unwind' function is going away with the new EH rewrite. This is step 0 in keeping front-ends from using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136683 91177308-0d34-0410-b5e6-96231b3b80d8
* Add braces.Jay Foad2011-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136612 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify printAlias.Jay Foad2011-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136611 91177308-0d34-0410-b5e6-96231b3b80d8
* Micro-optimisation in getAliasedGlobal.Jay Foad2011-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136610 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-31
| | | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136589 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