summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
...
* De-constify Types in FunctionType::get().Jay Foad2011-07-113-5/+5
| | | | llvm-svn: 134888
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-093-71/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* Remove unused copy of UpdateInlinedAtInfo.Benjamin Kramer2011-07-081-12/+0
| | | | llvm-svn: 134720
* Refactor. It is inliner's responsibility to update line number information.Devang Patel2011-07-082-38/+40
| | | | llvm-svn: 134708
* Fix a bug in the "expect" intrinsic lowering.Jakub Staszak2011-07-061-1/+4
| | | | llvm-svn: 134566
* Simplify. Consolidate dbg.declare handling in AllocaPromoter.Devang Patel2011-07-061-11/+3
| | | | llvm-svn: 134538
* Introduce "expect" intrinsic instructions.Jakub Staszak2011-07-062-0/+164
| | | | llvm-svn: 134516
* Add r134057 back, but splice the predecessor after the successors phiRafael Espindola2011-06-302-11/+13
| | | | | | | | | nodes. Original message: Let simplify cfg simplify bb with only debug and lifetime intrinsics. llvm-svn: 134182
* Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and Chad Rosier2011-06-292-13/+11
| | | | | | lifetime intrinsics" due to buildbot failures. llvm-svn: 134071
* Let simplify cfg simplify bb with only debug and lifetime intrinsics.Rafael Espindola2011-06-292-11/+13
| | | | llvm-svn: 134057
* Fix typo in comment.Nick Lewycky2011-06-281-1/+1
| | | | llvm-svn: 133990
* Move onlyUsedByLifetimeMarkers to ValueTracking so that it can be used by otherNick Lewycky2011-06-271-16/+1
| | | | | | passes as well. llvm-svn: 133904
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-237-94/+98
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-237-98/+94
| | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. llvm-svn: 133700
* Remove unused variables.Benjamin Kramer2011-06-211-2/+2
| | | | llvm-svn: 133514
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-217-87/+91
| | | | | | self-hosted build failure has been fixed (r133512). llvm-svn: 133513
* Revert r133435 and r133449 to appease buildbots.Chad Rosier2011-06-217-91/+87
| | | | llvm-svn: 133499
* Change how PHINodes store their operands.Jay Foad2011-06-207-87/+91
| | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
* Fix PR10103: Less code for enum type translation.Hans Wennborg2011-06-181-0/+74
| | | | | | | | | | | In cases such as the attached test, where the case value for a switch destination is used in a phi node that follows the destination, it might be better to replace that value with the condition value of the switch, so that more blocks can be folded away with TryToSimplifyUncondBranchFromEmptyBlock because there are less conflicts in the phi node. llvm-svn: 133344
* Set debug loc for new preheader's terminator.Devang Patel2011-06-171-0/+1
| | | | llvm-svn: 133298
* When promoting an alloca to registers discard any lifetime intrinsics.Nick Lewycky2011-06-171-0/+59
| | | | llvm-svn: 133251
* Simplify; no significant functionality change.Eli Friedman2011-06-151-26/+2
| | | | llvm-svn: 133086
* Fix cmake build.Rafael Espindola2011-06-151-1/+0
| | | | llvm-svn: 133085
* Remove unused code.Eli Friedman2011-06-151-128/+0
| | | | llvm-svn: 133078
* Use IRBuilder to make our intrinsic calls in the inliner so that we pick upJohn McCall2011-06-141-10/+9
| | | | | | line info correctly. llvm-svn: 132961
* Use Value::stripPointerCasts instead of reinventing part of the wheel.Nick Lewycky2011-06-141-6/+2
| | | | llvm-svn: 132954
* It's possible that an all-zero GEP may be used as the argument to lifetimeNick Lewycky2011-06-131-2/+6
| | | | | | | | | intrinsics. In fact, we'll optimize a bitcast to that when possible. Detect it when looking for the lifetime intrinsics. No test case, noticed by inspection. llvm-svn: 132906
* SplitCriticalEdge can sometimes split the edge from an invoke to a landingJohn McCall2011-06-091-28/+184
| | | | | | | | | | | | pad, separating the exception and selector calls from the new lpad. Teaching it not to do that, or to properly adjust the CFG afterwards, is out of scope because it would require the other edges to the landing pad to be split as well (effectively). Instead, just recover from the most likely cases during inlining. The best long-term solution is to change the exception representation and commit to either requiring or not requiring the more complex edge-splitting logic; this is just a shorter-term hack. llvm-svn: 132799
* Teach the CallGraph to ignore calls to intrinsics.John McCall2011-06-091-41/+7
| | | | llvm-svn: 132797
* If the block that we're threading through is jumped to by an indirect branch,Bill Wendling2011-06-041-1/+3
| | | | | | | | | | | | then we don't want to set the destination in the indirect branch to the destination. This is because the indirect branch needs its destinations to have had their block addresses taken. This isn't so of the new critical edge that's split during this process. If it turns out that the destination block has only one predecessor, and that being a BB with an indirect branch, then it won't be marked as 'used' and may be removed. PR10072 llvm-svn: 132638
* First, do no harm -- even if we can't find a selector for an enclosingJohn McCall2011-06-011-4/+18
| | | | | | | landing pad, forward llvm.eh.resume calls to it instead of turning them invalidly into invokes. llvm-svn: 132382
* Fix this to work correctly with phis; test case to follow if this successfullyJohn McCall2011-05-291-0/+1
| | | | | | fixes self-host. llvm-svn: 132275
* Implement and document the llvm.eh.resume intrinsic, which isJohn McCall2011-05-281-62/+181
| | | | | | | | | | | | | | | | | transformed by the inliner into a branch to the enclosing landing pad (when inlined through an invoke). If not so optimized, it is lowered DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume as appropriate). Its chief advantage is that it takes both the exception value and the selector value as arguments, meaning that there is zero effort in recovering these; however, the frontend is required to pass these down, which is not actually particularly difficult. Also document the behavior of landing pads a bit better, and make it clearer that it's okay that personality functions don't always land at landing pads. This is just a fact of life. Don't write optimizations that rely on pushing things over an unwind edge. llvm-svn: 132253
* Fix the inliner to maintain the current de facto invoke semantics:John McCall2011-05-271-42/+155
| | | | | | | | | | | | | | - the selector for the landing pad must provide all available information about the handlers, filters, and cleanups within that landing pad - calls to _Unwind_Resume must be converted to branches to the enclosing lpad so as to avoid re-entering the unwinder when the lpad claimed it was going to handle the exception in some way This is quite specific to libUnwind-based unwinding. In an effort to not interfere too badly with other unwinders, and with existing hacks in frontends, this only triggers on _Unwind_Resume (not _Unwind_Resume_or_Rethrow) and does nothing with selectors if it cannot find a selector call for either lpad. llvm-svn: 132200
* One more debug line number miss in instcombine (although the code in ↵Eli Friedman2011-05-271-5/+1
| | | | | | question isn't actually in instcombine). llvm-svn: 132170
* Clean up the lazy initialization of DIBuilder a bit.Cameron Zwarich2011-05-241-9/+3
| | | | llvm-svn: 131956
* Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values whenCameron Zwarich2011-05-243-19/+38
| | | | | | promoting allocas to SSA variables. Fixes <rdar://problem/9479036>. llvm-svn: 131953
* Add a parameter to ConstantFoldTerminator() that callers can use to ask it ↵Frits van Bommel2011-05-222-7/+19
| | | | | | | | to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior. I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this. llvm-svn: 131855
* Teach the inliner to emit llvm.lifetime.start/end, to scope the local variablesNick Lewycky2011-05-221-0/+70
| | | | | | of the inlinee to the code representing the original function. llvm-svn: 131838
* Reapply r131605. This time with a fix, which is to use NoFolder.Devang Patel2011-05-191-30/+34
| | | | llvm-svn: 131673
* revert 131605 to fix PR9946.Rafael Espindola2011-05-191-36/+31
| | | | llvm-svn: 131620
* Use IRBuilder.Devang Patel2011-05-191-2/+2
| | | | llvm-svn: 131609
* Use IRBuilder while simplifying unreachable.Devang Patel2011-05-191-7/+8
| | | | llvm-svn: 131607
* Use IRBuilder while simplifying conditional branch.Devang Patel2011-05-181-31/+36
| | | | llvm-svn: 131605
* Use IRBuilder while simplifying branch.Devang Patel2011-05-181-12/+13
| | | | llvm-svn: 131598
* Use IRBuilder while simplifying return instruction.Devang Patel2011-05-181-11/+13
| | | | llvm-svn: 131580
* Spread use of IRBuilder even more.Devang Patel2011-05-181-10/+12
| | | | llvm-svn: 131571
* Use IRBuilder while simplifying switch instruction.Devang Patel2011-05-181-15/+18
| | | | llvm-svn: 131566
* Use IRBuilder while simplifying unwind.Devang Patel2011-05-181-7/+9
| | | | llvm-svn: 131561
* Use IRBuilder while simplifying terminator.Devang Patel2011-05-181-4/+7
| | | | llvm-svn: 131552
OpenPOWER on IntegriCloud