summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Refactor code from inlining and globalopt that checks whether a function ↵Eli Friedman2011-10-201-0/+15
| | | | | | definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. llvm-svn: 142572
* Use a SmallVector for intrinsic argument types.Benjamin Kramer2011-10-171-1/+1
| | | | llvm-svn: 142259
* Correct over-zealous removal of hack.Bill Wendling2011-10-171-0/+15
| | | | | | | Some code want to check that *any* call within a function has the 'returns twice' attribute, not just that the current function has one. llvm-svn: 142221
* Now that we have the ReturnsTwice function attribute, this method isBill Wendling2011-10-171-40/+0
| | | | | | | obsolete. Check the attribute instead. <rdar://problem/8031714> llvm-svn: 142212
* Add a routine to swap branch instruction operands, and update anyChandler Carruth2011-10-171-0/+21
| | | | | | | | | | | | profile metadata at the same time. Use it to preserve metadata attached to a branch when re-writing it in InstCombine. Add metadata to the canonicalize_branch InstCombine test, and check that it is tranformed correctly. Reviewed by Nick Lewycky! llvm-svn: 142168
* Let printf do the formatting instead aligning strings ourselves.Benjamin Kramer2011-10-161-1/+1
| | | | | | While at it, merge some format strings. llvm-svn: 142140
* Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2011-10-161-1/+1
| | | | | | | | note/warning/error as a string, pass it around as an enum. llvm-svn: 142107
* constify array itself, don't iterate multiple times.Chris Lattner2011-10-141-2/+2
| | | | llvm-svn: 142013
* ocaml bindings: add getopcode for constant and instruction, and int64_of_const.Torok Edwin2011-10-141-0/+6
| | | | llvm-svn: 141990
* bindings: tab and indentation fixes of my previous commitsTorok Edwin2011-10-141-25/+25
| | | | llvm-svn: 141989
* Spacing.Eric Christopher2011-10-111-1/+1
| | | | llvm-svn: 141727
* Move default to top of switchMatt Beaumont-Gay2011-10-071-6/+4
| | | | llvm-svn: 141366
* Remove the old atomic instrinsics. autoupgrade functionality is included ↵Eli Friedman2011-10-061-0/+91
| | | | | | with this patch. llvm-svn: 141333
* Fix -asserts buildMatt Beaumont-Gay2011-10-061-0/+2
| | | | llvm-svn: 141313
* Don't require C bindings opcode numbers to be kept in sync.Torok Edwin2011-10-061-3/+28
| | | | | | | | They are not in sync now, for example Bitcast would show up as LLVMCall. So instead introduce 2 functions that map to and from the opcodes in the C bindings. llvm-svn: 141290
* ocaml/C bindings: type->isSized()Torok Edwin2011-10-061-0/+5
| | | | llvm-svn: 141288
* add binding to read icmp predicateTorok Edwin2011-10-061-0/+9
| | | | llvm-svn: 141287
* ocaml/C bindings: getmdstring, add num_op, get_op should work on metadata tooTorok Edwin2011-10-061-2/+34
| | | | llvm-svn: 141286
* C/OCaml API to retrieve struct name.Torok Edwin2011-10-061-0/+8
| | | | llvm-svn: 141285
* Build system infrastructure for multiple tblgens.Peter Collingbourne2011-10-061-2/+2
| | | | llvm-svn: 141266
* Check for the returns_twice attribute in callsFunctionThatReturnsTwice. ThisRafael Espindola2011-10-051-10/+19
| | | | | | fixes PR11038, but there are still some cleanups to be done. llvm-svn: 141204
* Unbreak CMake build.Ted Kremenek2011-10-041-1/+2
| | | | llvm-svn: 141097
* Put GCOVFile and other related interface in a common header so that llvm-cov ↵Devang Patel2011-10-041-0/+281
| | | | | | tool can share it with GCOV writer. llvm-svn: 141095
* Add C api for Instruction->eraseFromParent().Devang Patel2011-10-031-0/+4
| | | | llvm-svn: 141023
* Add the returns_twice attribute to LLVM.Rafael Espindola2011-10-031-2/+2
| | | | llvm-svn: 141001
* Tracing or debug-printing a newly formed instruction should not crash.Andrew Trick2011-09-301-1/+2
| | | | llvm-svn: 140874
* whitespaceAndrew Trick2011-09-301-38/+38
| | | | llvm-svn: 140873
* Clean up uses of switch instructions so they are not dependent on the ↵Eli Friedman2011-09-291-6/+8
| | | | | | operand ordering. Patch by Stepan Dyatkovskiy. llvm-svn: 140803
* Cosmetic changes, as per Nick's review.Devang Patel2011-09-291-0/+1
| | | | llvm-svn: 140785
* Check that catch clauses have pointer type.Duncan Sands2011-09-271-2/+7
| | | | llvm-svn: 140625
* Have the verifier check that all landingpad operands are constants.Duncan Sands2011-09-271-0/+11
| | | | llvm-svn: 140606
* The last verification check for the new EH model.Bill Wendling2011-09-211-0/+6
| | | | | | This makes sure that the unwind destination of an invoke is a landing pad. llvm-svn: 140280
* 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
OpenPOWER on IntegriCloud