summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Change test case, one that actually failed before my commit.Evan Cheng2011-07-131-1/+6
| | | | llvm-svn: 135064
* It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is ↵Evan Cheng2011-07-131-2/+19
| | | | | | another use of sqrt. rdar://9763193 llvm-svn: 135058
* Don't duplicate the work done by a gep into a "bitcast" if the gep hasRafael Espindola2011-07-111-0/+16
| | | | | | | | more than one use. Fixes PR10322. llvm-svn: 134883
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-0917-103/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* more tests not making the jump into the brave new world.Chris Lattner2011-07-092-183/+0
| | | | llvm-svn: 134820
* Added test cases for GVN signed intrinsics recognition, r134777.Lang Hames2011-07-091-0/+38
| | | | llvm-svn: 134778
* Make GVN look through extractvalues for recognised intrinsics. GVN can then ↵Lang Hames2011-07-081-0/+47
| | | | | | CSE ops that match values produced by the intrinsics. llvm-svn: 134677
* indvars -disable-iv-rewrite: Added SimplifyCongruentIVs.Andrew Trick2011-07-062-4/+55
| | | | llvm-svn: 134530
* LICM: Do not loose alignment on promotionTobias Grosser2011-07-061-0/+26
| | | | | | | | The promotion code lost any alignment information, when hoisting loads and stores out of the loop. This lead to incorrect aligned memory accesses. We now use the largest alignment we can prove to be correct. llvm-svn: 134520
* Introduce "expect" intrinsic instructions.Jakub Staszak2011-07-062-0/+254
| | | | llvm-svn: 134516
* PR10267: Don't combine an equality compare with an AND into an inequality ↵Benjamin Kramer2011-07-041-0/+12
| | | | | | | | compare when the AND has more than one use. This can pessimize code, inequalities are generally more expensive. llvm-svn: 134379
* indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.Andrew Trick2011-07-022-4/+30
| | | | llvm-svn: 134306
* Improve constant folding of undef for cmp and select operators.Dan Gohman2011-07-011-0/+28
| | | | llvm-svn: 134223
* Improve constant folding of undef for binary operators.Dan Gohman2011-07-011-0/+99
| | | | llvm-svn: 134221
* Add r134057 back, but splice the predecessor after the successors phiRafael Espindola2011-06-301-0/+29
| | | | | | | | | nodes. Original message: Let simplify cfg simplify bb with only debug and lifetime intrinsics. llvm-svn: 134182
* indvars -disable-iv-rewrite: handle cloning binary operators that cannot ↵Andrew Trick2011-06-301-4/+38
| | | | | | overflow. llvm-svn: 134177
* indvars -disable-iv-rewrite: handle an edge case involving identity phis.Andrew Trick2011-06-301-7/+32
| | | | llvm-svn: 134124
* indvars -disable-iv-rewrite: insert new trunc instructions carefully.Andrew Trick2011-06-291-2/+31
| | | | llvm-svn: 134112
* Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and Chad Rosier2011-06-291-29/+0
| | | | | | lifetime intrinsics" due to buildbot failures. llvm-svn: 134071
* Let simplify cfg simplify bb with only debug and lifetime intrinsics.Rafael Espindola2011-06-291-0/+29
| | | | llvm-svn: 134057
* indvars -disable-iv-rewrite: just because SCEV ignores casts doesn'tAndrew Trick2011-06-291-0/+37
| | | | | | mean they can be removed. llvm-svn: 134054
* FileCheckify and prepare for -disable-iv-rewrite.Andrew Trick2011-06-281-7/+11
| | | | llvm-svn: 133998
* Teach one piece of scalarrepl to handle lifetime markers. When transforming anNick Lewycky2011-06-271-0/+14
| | | | | | | | alloca that only holds a copy of a global and we're going to replace the users of the alloca with that global, just nuke the lifetime intrinsics. Part of PR10121. llvm-svn: 133905
* PR10180: Fix a instcombine crash with FP vectors.Eli Friedman2011-06-231-0/+12
| | | | llvm-svn: 133756
* Add a reduced test case for the buildbot failure (clang self-hostedJay Foad2011-06-211-0/+182
| | | | | | build) caused by r133435. llvm-svn: 133509
* indvars -disable-iv-rewrite: Adds support for eliminating identityAndrew Trick2011-06-211-0/+1
| | | | | | | | | | | | | | | | | | | ops. This is a rewrite of the IV simplification algorithm used by -disable-iv-rewrite. To avoid perturbing the default mode, I temporarily split the driver and created SimplifyIVUsersNoRewrite. The idea is to avoid doing opcode/pattern matching inside IndVarSimplify. SCEV already does it. We want to optimize with the full generality of SCEV, but optimize def-use chains top down on-demand rather than rewriting the entire expression bottom-up. This was easy to do for operations that SCEV can prove are identity function. So we're now eliminating bitmasks and zero extends this way. A result of this rewrite is that indvars -disable-iv-rewrite no longer requires IVUsers. llvm-svn: 133502
* This is an automatically reduced test case that crashed in GVN, at someJay Foad2011-06-201-0/+106
| | | | | | point during the development of the phi operand changes. llvm-svn: 133436
* Remove support for parsing the "type i32" syntax for defining a numberedChris Lattner2011-06-192-6/+6
| | | | | | | top level type without a specified number. This syntax isn't documented and blocks forward progress. llvm-svn: 133371
* Fix PR10103: Less code for enum type translation.Hans Wennborg2011-06-182-1/+37
| | | | | | | | | | | 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
* Add test for r133251.Nick Lewycky2011-06-181-0/+26
| | | | llvm-svn: 133339
* When scalar replacement returns a vector type, only accept it if the vectorCameron Zwarich2011-06-182-2/+19
| | | | | | | | | | | | type's bitwidth matches the (allocated) size of the alloca. This severely pessimizes vector scalar replacement when the only vector type being used is something like <3 x float> on x86 or ARM whose allocated size matches a <4 x float>. I hope to fix some of the flawed assumptions about allocated size throughout scalar replacement and reenable this in most cases. llvm-svn: 133338
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-1837-795/+588
| | | | | | | | | for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. llvm-svn: 133337
* Fix an invalid bitcast crash that occurs when doing a partial memset of a vectorCameron Zwarich2011-06-181-0/+22
| | | | | | alloca. Fixes part of <rdar://problem/9580800>. llvm-svn: 133336
* Stop accepting and ignoring attributes in function types. Attributes are ↵Chris Lattner2011-06-173-3/+3
| | | | | | | | applied to functions and call/invokes, not to types. llvm-svn: 133266
* make the asmparser reject function and type redefinitions. 'Merging' hasn't ↵Chris Lattner2011-06-175-9/+0
| | | | | | | | been needed since llvm-gcc 3.4 days. llvm-svn: 133248
* remove asmparser support for the old getresult instruction, which has been ↵Chris Lattner2011-06-173-3/+3
| | | | | | subsumed by extractvalue. llvm-svn: 133247
* remove parser support for the obsolete "multiple return values" syntax, whichChris Lattner2011-06-177-248/+31
| | | | | | was replaced with return of a "first class aggregate". llvm-svn: 133245
* stop accepting begin/end around function bodies in the .ll parser, this ↵Chris Lattner2011-06-171-4/+2
| | | | | | isn't pascal anymore. llvm-svn: 133244
* Remove support for using "foo" as symbols instead of %"foo". This is ancientChris Lattner2011-06-172-3/+0
| | | | | | | syntax and has been long obsolete. As usual, updating the tests is the nasty part of this. llvm-svn: 133242
* manually upgrade a bunch of tests to modern syntax, and remove some thatChris Lattner2011-06-1729-1637/+43
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
* Fix ARCOpt to insert releases on both successors of an invoke ratherDan Gohman2011-06-161-0/+67
| | | | | | than trying to insert them immediately after the invoke. llvm-svn: 133188
* The ARC language-specific optimizer. Credit to Dan Gohman.John McCall2011-06-1519-0/+3383
| | | | llvm-svn: 133108
* Avoid fusing bitcasts with dynamic allocas if the amount-to-allocateStuart Hastings2011-06-131-0/+60
| | | | | | | | might overflow. Re-typing the alloca to a larger type (e.g. double) hoists a shift into the alloca, potentially exposing overflow in the expression. rdar://problem/9265821 llvm-svn: 132926
* InstCombine: Fold A-b == C --> b == A-C if A and C are constants.Benjamin Kramer2011-06-131-0/+16
| | | | | | The backend already knew this trick. llvm-svn: 132915
* InstCombine: Shrink ((zext X) & C1) == C2 to fold away the cast if the ↵Benjamin Kramer2011-06-121-0/+10
| | | | | | "zext" and the "and" have one use. llvm-svn: 132897
* Simplify code. No functionality changes, name changes aside.Benjamin Kramer2011-06-121-2/+2
| | | | llvm-svn: 132896
* SplitCriticalEdge can sometimes split the edge from an invoke to a landingJohn McCall2011-06-091-1/+92
| | | | | | | | | | | | 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
* Fix PR10104 by adding a bounds check on a vector element access check. It wasCameron Zwarich2011-06-091-3/+5
| | | | | | | | assuming that all offsets are legal vector accesses, and thus trying to access the float member of { <2 x float>, float } as the 3rd element of the first member. llvm-svn: 132766
* Fix an assymmetry between ConvertScalar_ExtractValue and ↵Cameron Zwarich2011-06-081-0/+60
| | | | | | | | | | ConvertScalar_InsertValue. The former was using the size of the entire alloca, whereas the latter was correctly using the allocated size of the immediate type being converted (which may differ from the size of the alloca). This fixes PR10082. llvm-svn: 132759
* This directory was missing the dg.exp to cause the tests to run. Some time sinceNick Lewycky2011-06-062-0/+4
| | | | | | it was added, the test has regressed, so XFAIL it. llvm-svn: 132686
OpenPOWER on IntegriCloud