summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'Bill Wendling2011-08-164-19/+10
| | | | | | check for a LandingPadInst. llvm-svn: 137745
* I think there was some confusion about what I meant. :-) Replacing the comment.Bill Wendling2011-08-161-1/+4
| | | | llvm-svn: 137743
* Add a mechanism for optimisation plugins to register passes that all front ↵David Chisnall2011-08-161-0/+15
| | | | | | | | ends can use without needing to be aware of the plugin (or the plugin be aware of the front end). Before 3.0, I'd like to add a mechanism for automatically loading a set of plugins from a config file. API suggestions welcome... llvm-svn: 137717
* A few places where we want to skip the landingpad instruction for insertion.Bill Wendling2011-08-162-1/+4
| | | | llvm-svn: 137712
* Revert a bit of r137667; the logic in question can safely handle atomic ↵Eli Friedman2011-08-161-4/+4
| | | | | | load/store. llvm-svn: 137702
* After talking with Bill, it seems like the LandingPad handling here is likelyEli Friedman2011-08-161-4/+1
| | | | | | to be wrong (or at least somewhat suspect). Leave a FIXME for Bill. llvm-svn: 137694
* Minor comment fixes.Eli Friedman2011-08-162-5/+7
| | | | llvm-svn: 137693
* Update SimplifyCFG for atomic operations.Eli Friedman2011-08-151-10/+26
| | | | | | | | This commit includes a mention of the landingpad instruction, but it's not changing the behavior around it. I think the current behavior is correct, though. Bill, can you double-check that? llvm-svn: 137691
* Add comments and test for atomic load/store and mem2reg.Eli Friedman2011-08-151-0/+4
| | | | llvm-svn: 137690
* In places where it's using "getFirstNonPHI", skip the landingpad instruction ↵Bill Wendling2011-08-151-5/+8
| | | | | | if necessary. llvm-svn: 137679
* Don't sink the instruction to before a landingpad instruction.Bill Wendling2011-08-151-1/+1
| | | | llvm-svn: 137672
* Update inter-procedural optimizations for atomic load/store.Eli Friedman2011-08-154-10/+16
| | | | llvm-svn: 137667
* Update instcombine for atomic load/store.Eli Friedman2011-08-153-31/+39
| | | | llvm-svn: 137664
* Duncan pointed out that the LandingPadInst might read memory. (It might alsoBill Wendling2011-08-151-3/+2
| | | | | | write to memory.) Marking it as such makes some checks for immobility go away. llvm-svn: 137655
* Fix llvm::CloneModule to correctly clone globals. Patch per bug report by ↵Eli Friedman2011-08-151-14/+13
| | | | | | Simon Moll on llvmdev. llvm-svn: 137654
* Atomic load/store support in LICM.Eli Friedman2011-08-151-6/+10
| | | | llvm-svn: 137648
* The "landingpad" instruction will never be "trivially" dead.Bill Wendling2011-08-151-0/+4
| | | | llvm-svn: 137642
* Don't try to sink the landingpad instruction. It's immobile.Bill Wendling2011-08-151-2/+3
| | | | llvm-svn: 137629
* Mark the SCC as "might unwind" if we run into a 'resume' instruction.Bill Wendling2011-08-151-2/+3
| | | | llvm-svn: 137627
* Skip the insertion iterator past the landingpad instruction if there.Bill Wendling2011-08-151-0/+1
| | | | llvm-svn: 137626
* Add inlining for the new EH scheme.Bill Wendling2011-08-141-17/+146
| | | | | | | | | | | | | This builds off of the current scheme, but instead of llvm.eh.exception and llvm.eh.selector, it uses the landingpad instruction. And instead of llvm.eh.resume, it uses the resume instruction. Because of the invariants in the landing pad instruction, a lot of code that's currently needed to find the appropriate intrinsic calls for an invoke instruction won't be needed once we go to the new EH scheme. The "FIXME"s tell us what to remove after we switch. llvm-svn: 137576
* This transform is not safe. Thanks to Eli for pointing that out!Nick Lewycky2011-08-141-8/+1
| | | | llvm-svn: 137575
* Don't attempt to add 'nsw' when intermediate instructions had no such guarantee.Nick Lewycky2011-08-141-4/+7
| | | | llvm-svn: 137572
* Teach instcombine to preserve the nsw bit by doing an after-the-fact analysisNick Lewycky2011-08-141-3/+54
| | | | | | when combining add and sub instructions. Patch by Pranav Bhandarkar! llvm-svn: 137570
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-121-0/+1
| | | | | | | | | | | | 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
* switch to use the new api for structtypes.Chris Lattner2011-08-122-2/+2
| | | | llvm-svn: 137480
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-122-1/+3
| | | | | | when building with assertions disabled. llvm-svn: 137460
* Don't convert objc_autoreleaseReturnValue to objc_autorelease if the resultDan Gohman2011-08-121-6/+13
| | | | | | is returned through a bitcast. llvm-svn: 137402
* Don't let arbitrary calls disrupt nested retain+release pairs ifDan Gohman2011-08-121-56/+78
| | | | | | | | | the retains and releases all use the same SSA pointer value. Also, don't let CFG hazards disrupt nested retain+release pair optimizations. llvm-svn: 137399
* Use an actual reverse-CFG reverse-postorder for the bottom-up traversal,Dan Gohman2011-08-121-16/+30
| | | | | | | rather than plain postorder, so that CFG constructs like single-exit loops are reliably visited in a sensible order. llvm-svn: 137398
* Allow loop unrolling to get known trip counts from ScalarEvolution.Andrew Trick2011-08-111-7/+23
| | | | | | | | | | | | | SCEV unrolling can unroll loops with arbitrary induction variables. It is a prerequisite for -disable-iv-rewrite performance. It is also easily handles loops of arbitrary structure including multiple exits and is generally more robust. This is under a temporary option to avoid affecting default behavior for the next couple of weeks. It is needed so that I can checkin unit tests for updateUnloop. llvm-svn: 137384
* Fix typos in comments, and delete an unused function.Dan Gohman2011-08-111-6/+2
| | | | llvm-svn: 137352
* Distinguish between two copies of one inlined variable. Take 2.Devang Patel2011-08-101-1/+8
| | | | llvm-svn: 137253
* Comments. Thanks for the spell check Nick!Andrew Trick2011-08-102-4/+4
| | | | | | Also, my apologies for spoiling the autocomplete on SimplifyInstructions.cpp. I couldn't think of a better filename. llvm-svn: 137229
* Invoke SimplifyIndVar when we partially unroll a loop. Fixes PR10534.Andrew Trick2011-08-102-5/+25
| | | | llvm-svn: 137203
* Cleanup. Make ScalarEvolution an explicit argument of theAndrew Trick2011-08-102-11/+11
| | | | | | SimplifyIndVar utility since it is required. llvm-svn: 137202
* SimplifyIndVar: make foldIVUser iterative to fold a chain of operands.Andrew Trick2011-08-101-12/+26
| | | | llvm-svn: 137199
* Update CMake build.Benjamin Kramer2011-08-101-0/+1
| | | | llvm-svn: 137198
* Added a SimplifyIndVar utility to simplify induction variable usersAndrew Trick2011-08-102-328/+461
| | | | | | | | | | | | | | | | based on ScalarEvolution without changing the induction variable phis. This utility is the main tool of IndVarSimplifyPass, but the pass also restructures induction variables in strange ways that are sensitive to pass ordering. This provides a way for other loop passes to simplify new uses of induction variables created during transformation. The utility may be used by any pass that preserves ScalarEvolution. Soon LoopUnroll will use it. The net effect in this checkin is to cleanup the IndVarSimplify pass by factoring out the SimplifyIndVar algorithm into a standalone utility. llvm-svn: 137197
* Cleanup. Added LoopBlocksDFS::perform for simple clients.Andrew Trick2011-08-101-7/+2
| | | | llvm-svn: 137195
* Fix the LoopUnroller to handle nontrivial loops and partial unrolling.Andrew Trick2011-08-101-52/+60
| | | | | | | | | | These are not individual bug fixes. I had to rewrite a good chunk of the unroller to make it sane. I think it was getting lucky on trivial completely unrolled loops with no early exits. I included some fairly simple unit tests for partial unrolling. I didn't do much stress testing, so it may not be perfect, but should be usable now. llvm-svn: 137190
* Representation of 'atomic load' and 'atomic store' in IR.Eli Friedman2011-08-091-0/+17
| | | | llvm-svn: 137170
* Add a C interface to PassManagerBuilder. It is missing the addExtensionRafael Espindola2011-08-091-0/+80
| | | | | | | functionality since in the C api a pass is created and added to a pass manager in a single call. llvm-svn: 137159
* LoopUnroll looks like it has some stale code. Remove it to prove my sanity ↵Andrew Trick2011-08-091-6/+1
| | | | | | and avoid further confusion. llvm-svn: 137106
* There is only one instance of this placeholder being created. Just use thatBill Wendling2011-08-091-6/+6
| | | | | | instead of a vector. llvm-svn: 137099
* Remove an instance where the 'unwind' instruction was created.Bill Wendling2011-08-091-2/+10
| | | | | | | | | The 'unwind' instruction was acting essentially as a placeholder, because it would be replaced at the end of this function by a branch to the "unwind handler". The 'unwind' instruction is going away, so use 'unreachable' instead, which serves the same purpose as a placeholder. llvm-svn: 137098
* Made SCEV's UDiv expressions more canonical. When dividing aAndrew Trick2011-08-061-0/+65
| | | | | | | | | | | | | | | | | | | | | | | recurrence, the initial values low bits can sometimes be ignored. To take advantage of this, added FoldIVUser to IndVarSimplify to fold an IV operand into a udiv/lshr if the operator doesn't affect the result. -indvars -disable-iv-rewrite now transforms i = phi i4 i1 = i0 + 1 idx = i1 >> (2 or more) i4 = i + 4 into i = phi i4 idx = i0 >> ... i4 = i + 4 llvm-svn: 137013
* Temporarily revert r135528 which distinguishes between two copies of oneChandler Carruth2011-08-051-8/+1
| | | | | | | | | | | | | | | | | | | inlined variable, based on the discussion in PR10542. This explodes the runtime of several passes down the pipeline due to a large number of "copies" remaining live across a large function. This only shows up with both debug and opt, but when it does it creates a many-minute compile when self-hosting LLVM+Clang. There are several other cases that show these types of regressions. All of this is tracked in PR10542, and progress is being made on fixing the issue. Once its addressed, the re-instated, but until then this restores the performance for self-hosting and other opt+debug builds. Devang, let me know if this causes any trouble, or impedes fixing it in any way, and thanks for working on this! llvm-svn: 136953
* We need to map DebugLoc. It leads to Fuction * (through subprogram entry ↵Devang Patel2011-08-041-3/+2
| | | | | | node) which should be appropriately mapped. llvm-svn: 136910
* Fix an obvious type. Patch by Ivan Krasin.Evan Cheng2011-08-041-1/+1
| | | | llvm-svn: 136900
OpenPOWER on IntegriCloud