summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* LSR wants to split the landing pad's critical edge. Let it do it, but use theBill Wendling2011-08-251-1/+8
| | | | | | proper function to do it. llvm-svn: 138550
* When inserting new instructions, use getFirstInsertionPt instead ofBill Wendling2011-08-252-5/+6
| | | | | | getFirstNonPHI so that it will skip over the landingpad instructions as well. llvm-svn: 138537
* Skip the landingpad instruction when determining the insertion point.Bill Wendling2011-08-241-0/+3
| | | | llvm-svn: 138481
* Use getFirstInsertionPt instead of getFirstNonPHI so that it skips to the properBill Wendling2011-08-241-3/+3
| | | | | | insertion place. llvm-svn: 138473
* Add a comment.Dan Gohman2011-08-221-0/+4
| | | | llvm-svn: 138243
* Constant pointers to objects don't need reference counting.Dan Gohman2011-08-221-0/+13
| | | | llvm-svn: 138242
* The landingpad instruction isn't dead simply because it's value isn't used.Bill Wendling2011-08-191-1/+1
| | | | llvm-svn: 138102
* Make a bunch of symbols private.Benjamin Kramer2011-08-191-2/+2
| | | | llvm-svn: 138025
* Track a retain+release nesting level independently of theDan Gohman2011-08-191-36/+64
| | | | | | | | known-incremented level, because the two concepts can be used to prove the saftey of a retain+release removal in different ways. llvm-svn: 138016
* Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.Bill Wendling2011-08-181-3/+3
| | | | llvm-svn: 138008
* Make it clear that this code is iterating in reverse order through the array.Dan Gohman2011-08-181-2/+3
| | | | llvm-svn: 137985
* Dramatically speedup codegen prepare by a) avoiding use of dominator tree ↵Devang Patel2011-08-181-16/+38
| | | | | | and b) doing a separate pass over dbg.value instructions. llvm-svn: 137908
* Atomic load/store handling for the passes using memdep (GVN, DSE, memcpyopt).Eli Friedman2011-08-173-9/+11
| | | | llvm-svn: 137888
* Disable PRE for landing pads.Bill Wendling2011-08-171-2/+14
| | | | | | | | PRE needs the landing pads to have their critical edges split. Doing this for a landing pad is non-trivial. Abandon the attempt to perform PRE when we come across a landing pad. (Reviewed by Owen!) llvm-svn: 137876
* Silly mistake from r137777; restore significant isStructTy() checks. While ↵Eli Friedman2011-08-171-4/+19
| | | | | | | | | | here, be a bit more defensive with unknown instructions. Fixes PR10687. llvm-svn: 137836
* A bunch of misc fixes to SCCPSolver::ResolvedUndefsIn, including a fix to stopEli Friedman2011-08-161-40/+72
| | | | | | | | | making random bad assumptions about instructions which are not explicitly listed. Includes fix for rdar://9956541, a version of "undef ^ undef should return 0 because it's easier than arguing with users". llvm-svn: 137777
* Minor bug in SCCP found by inspection. (I don't think it's possible to hit ↵Eli Friedman2011-08-161-0/+7
| | | | | | this with a normal pass pipeline, but fixing for completeness.) llvm-svn: 137755
* Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'Bill Wendling2011-08-161-13/+6
| | | | | | check for a LandingPadInst. llvm-svn: 137745
* In places where it's using "getFirstNonPHI", skip the landingpad instruction ↵Bill Wendling2011-08-151-5/+8
| | | | | | if necessary. llvm-svn: 137679
* Atomic load/store support in LICM.Eli Friedman2011-08-151-6/+10
| | | | llvm-svn: 137648
* Skip the insertion iterator past the landingpad instruction if there.Bill Wendling2011-08-151-0/+1
| | | | llvm-svn: 137626
* 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
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-121-1/+1
| | | | | | 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
* Invoke SimplifyIndVar when we partially unroll a loop. Fixes PR10534.Andrew Trick2011-08-101-4/+1
| | | | llvm-svn: 137203
* Cleanup. Make ScalarEvolution an explicit argument of theAndrew Trick2011-08-101-2/+2
| | | | | | SimplifyIndVar utility since it is required. llvm-svn: 137202
* Added a SimplifyIndVar utility to simplify induction variable usersAndrew Trick2011-08-101-328/+48
| | | | | | | | | | | | | | | | 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
* Representation of 'atomic load' and 'atomic store' in IR.Eli Friedman2011-08-091-0/+17
| | | | llvm-svn: 137170
* 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
* Fix an obvious type. Patch by Ivan Krasin.Evan Cheng2011-08-041-1/+1
| | | | llvm-svn: 136900
* Add new atomic instructions to SCCP. No functional change, but stops debug ↵Eli Friedman2011-08-021-0/+2
| | | | | | spam. llvm-svn: 136723
* Revert r136503 and r136480 in an effort to fix non-determinism in the ↵Owen Anderson2011-08-021-22/+1
| | | | | | llvm-gcc buildbots on i386. Devang is looking into the root cause. llvm-svn: 136674
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-311-0/+1
| | | | | | | | | 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
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-301-2/+0
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Clear DbgValues in the end.Devang Patel2011-07-291-0/+1
| | | | llvm-svn: 136503
* Clean up debug info after reassociation.Devang Patel2011-07-291-1/+21
| | | | llvm-svn: 136480
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-291-0/+74
| | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) llvm-svn: 136457
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. llvm-svn: 136433
* Fix a use after free. An instruction can't be both an intrinsic call and a ↵Benjamin Kramer2011-07-281-1/+1
| | | | | | fence. llvm-svn: 136319
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-271-0/+2
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Misc mid-level changes for new 'fence' instruction.Eli Friedman2011-07-273-5/+18
| | | | llvm-svn: 136205
* Finish adding support for lifetime intrinsics to SROA. Fixes PR10121!Nick Lewycky2011-07-251-1/+110
| | | | llvm-svn: 136008
* Add missing space (this line is no longer pushing the 80-column limit).Nick Lewycky2011-07-251-1/+1
| | | | llvm-svn: 135973
* Add LLVMAddLowerExpectIntrinsicPass to the C API.Rafael Espindola2011-07-251-0/+4
| | | | llvm-svn: 135966
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-251-3/+2
| | | | llvm-svn: 135904
* Move trip count discovery outside of the generic LoopUnroll helper. ThisAndrew Trick2011-07-231-2/+7
| | | | | | removes its dependence on canonical induction variables. llvm-svn: 135829
OpenPOWER on IntegriCloud