summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
...
* Change:Richard Trieu2011-09-212-13/+13
| | | | | | | | | | | | assert(!"error message"); To: assert(0 && "error message"); which is more consistant across the code base. llvm-svn: 140234
* Add a check to make sure schedulePass() has not deleted stale RequiredPass.Devang Patel2011-09-131-3/+5
| | | | llvm-svn: 139642
* Add codegen support for vector select (in the IR this means a selectDuncan Sands2011-09-061-0/+6
| | | | | | | | | | | | 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. llvm-svn: 139159
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-061-0/+46
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 139140
* The insertion point for the loads is right before the llvm.eh.exceptionBill Wendling2011-09-041-1/+1
| | | | | | | | 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. llvm-svn: 139088
* Don't reload the values that are already there. The llvm.eh.resume uses the sameBill Wendling2011-09-031-7/+4
| | | | | | | values that the resume instruction uses. PR10850 llvm-svn: 139076
* No need to get fancy inserting a PHI node when the values are stored in stackBill Wendling2011-09-021-43/+15
| | | | | | | | 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. llvm-svn: 139035
* Return undef value (instead of arbitrary) for wrong or undef index inJakub Staszak2011-09-021-4/+4
| | | | | | ConstantVector. llvm-svn: 139007
* ConstantVector returns arbitrary value for the wrong index.Jakub Staszak2011-09-021-0/+4
| | | | | | This fixes PR10813. llvm-svn: 139006
* Perform the upgrading of the old EH to the new EH in a more sane manner.Bill Wendling2011-09-021-34/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | 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! llvm-svn: 138990
* Make isSafeToSpeculativelyExecute() return the right answer for some new ↵Eli Friedman2011-09-011-0/+4
| | | | | | instructions. Found by inspection; not sure what practical impact, if any, this has. llvm-svn: 138962
* Fixes following the CR by Chris and Duncan:Nadav Rotem2011-08-291-8/+11
| | | | | | | Optimize chained bitcasts of the form A->B->A. Undo r138722 and change isEliminableCastPair to allow this case. llvm-svn: 138756
* Dump with dbgs() instead of printf.Benjamin Kramer2011-08-291-5/+4
| | | | llvm-svn: 138749
* Make GCC happy by adding parens.Benjamin Kramer2011-08-291-2/+2
| | | | llvm-svn: 138748
* Reapply r138695. Fix PassManager stack depths.Andrew Trick2011-08-291-15/+25
| | | | | | Patch by Xiaoyi Guo! llvm-svn: 138737
* Reverting r138695 to see if it fixes clang self host.Andrew Trick2011-08-271-25/+15
| | | | llvm-svn: 138701
* Only delete instructions once.Bill Wendling2011-08-271-5/+6
| | | | llvm-svn: 138700
* Fix PassManager stack depths.Andrew Trick2011-08-271-15/+25
| | | | | | Patch by Xiaoyi Guo! llvm-svn: 138695
* Initial check in that will auto-upgrade the old EH scheme to the new EH scheme.Bill Wendling2011-08-251-0/+201
| | | | | | | | | | 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. llvm-svn: 138602
* Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.Nadav Rotem2011-08-241-3/+21
| | | | llvm-svn: 138469
* Add some useful accessors to c++ api that appear to be missing from the c apiNate Begeman2011-08-231-0/+14
| | | | llvm-svn: 138371
* Revert "Address Duncan's CR request:"Eric Christopher2011-08-231-21/+3
| | | | | | | | | | This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340) Conflicts: test/Transforms/InstCombine/bitcast.ll llvm-svn: 138366
* Address Duncan's CR request:Nadav Rotem2011-08-231-3/+21
| | | | | | | 1. Cleanup the tests in ConstantFolding.cpp 2. Implement isAllOnes for Constant, ConstantFP, ConstantVector llvm-svn: 138340
* Rip out the old StructType APIs as warned about on llvmdev last week.Chris Lattner2011-08-181-38/+0
| | | | llvm-svn: 137953
* Revert r137655. There is some question about whether the 'landingpad'Bill Wendling2011-08-171-2/+0
| | | | | | instruction should be marked as potentially reading and/or writing memory. llvm-svn: 137863
* The resume instruction may throw. Return 'true' in this case.Bill Wendling2011-08-161-1/+1
| | | | llvm-svn: 137757
* Add getFirstInsertionPt() method.Bill Wendling2011-08-161-0/+6
| | | | | | | | 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). llvm-svn: 137744
* Duncan pointed out that the LandingPadInst might read memory. (It might alsoBill Wendling2011-08-151-0/+2
| | | | | | write to memory.) Marking it as such makes some checks for immobility go away. llvm-svn: 137655
* Fix predicates methods on Instruction to handle atomic load/store correctly.Eli Friedman2011-08-151-7/+15
| | | | llvm-svn: 137652
* Remove the last improper use of getGlobalContext() from LLVM.Nick Lewycky2011-08-131-18/+1
| | | | | | | | | | | | 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. llvm-svn: 137546
* Move "atomic" and "volatile" designations on instructions after the opcodeEli Friedman2011-08-121-10/+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. llvm-svn: 137527
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-126-10/+192
| | | | | | | | | | | | 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. llvm-svn: 137501
* add ifdef's to let people easily remove these dead api for testing.Chris Lattner2011-08-121-8/+10
| | | | llvm-svn: 137483
* switch to the new struct apis.Chris Lattner2011-08-122-4/+4
| | | | llvm-svn: 137481
* forward to the correct constructor.Chris Lattner2011-08-121-3/+2
| | | | llvm-svn: 137479
* add two missing function implsChris Lattner2011-08-121-0/+11
| | | | llvm-svn: 137470
* add new accessors to reflect new terminology in struct types.Chris Lattner2011-08-121-2/+44
| | | | llvm-svn: 137468
* Whitespace.Eli Friedman2011-08-101-1/+1
| | | | llvm-svn: 137226
* VMCore/BasicBlock.cpp: Don't assume BasicBlock::iterator might end with a ↵NAKAMURA Takumi2011-08-091-2/+6
| | | | | | | | | | 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. llvm-svn: 137175
* Fix whitespace.NAKAMURA Takumi2011-08-091-4/+4
| | | | llvm-svn: 137174
* Representation of 'atomic load' and 'atomic store' in IR.Eli Friedman2011-08-093-22/+126
| | | | llvm-svn: 137170
* Indicate that there are changes if runOfFunction returns saying that there are.Bill Wendling2011-08-081-1/+1
| | | | | | Patch by Jingyue! llvm-svn: 137072
* Remove unnecessary space.Bill Wendling2011-08-081-1/+1
| | | | llvm-svn: 137041
* strengthen up an assertion: you can't create a constant structChris Lattner2011-08-071-2/+2
| | | | | | | with an opaque struct type, it doesn't make sense. This should resolve PR10473. llvm-svn: 137028
* fix PR10286, a problem with the .ll printer handling block addresses that ↵Chris Lattner2011-08-031-11/+20
| | | | | | are out-of-scope. llvm-svn: 136768
* Remove the LLVMBuildUnwind C API function.Bill Wendling2011-08-021-4/+0
| | | | | | | The 'unwind' function is going away with the new EH rewrite. This is step 0 in keeping front-ends from using it. llvm-svn: 136683
* Add braces.Jay Foad2011-08-011-1/+2
| | | | llvm-svn: 136612
* Simplify printAlias.Jay Foad2011-08-011-21/+2
| | | | llvm-svn: 136611
* Micro-optimisation in getAliasedGlobal.Jay Foad2011-08-011-1/+1
| | | | llvm-svn: 136610
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-313-0/+44
| | | | | | | | | 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). llvm-svn: 136589
OpenPOWER on IntegriCloud