aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* @llvm.dbg.stoppoint intrinsic is not used anymore.Devang Patel2010-03-011-98/+0
| | | | | | | Delete dead testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97489 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to use new debug info encoding scheme. As a bonus, now the test passes!Devang Patel2010-03-011-55/+64
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97487 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove this test because it checks wheter optimizer handled ↵Devang Patel2010-03-011-54/+0
| | | | | | @llvm.dbg.global_variable appropriately or not. LLVM does not use this scheme to encode debug info for global variables any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97480 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVM instruction syntax doesn't have trailing semicolons.Dan Gohman2010-03-011-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97456 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-widthJohn McCall2010-02-281-2/+1
| | | | | | | | | | payloads. APFloat's internal folding routines always make QNaNs now, instead of sometimes making QNaNs and sometimes SNaNs depending on the type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97364 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6414, a nondeterminism issue in IPSCCP which was becauseChris Lattner2010-02-271-0/+32
| | | | | | | of a subtle interation in a loop operating in densemap order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97288 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6435 another bug from the MallocInst elimination work.Chris Lattner2010-02-261-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97231 91177308-0d34-0410-b5e6-96231b3b80d8
* this file lacks a run line!Chris Lattner2010-02-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97208 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugsChris Lattner2010-02-251-0/+17
| | | | | | | introduced when mallocinst was eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97178 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-252-1/+66
| | | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97126 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't do (X != Y) ? X : Y -> X for floating-point values; it doesn'tDan Gohman2010-02-231-0/+53
| | | | | | | | | handle NaN properly. Do (X une Y) ? X : Y -> X if one of X and Y is not zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96955 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the code which constant-folded ptrtoint(inttoptr(x)+c) toDan Gohman2010-02-231-27/+0
| | | | | | | | | | | | getelementptr. Despite only doing so in the case where x is a known array object and c can be converted to an index within range, this could still be invalid if c is actually the address of an object allocated outside of LLVM. Also, SCEVExpander, the original motivation for this code, has since been improved to avoid inttoptr+ptroint in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96950 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert this test to FileCheck and add a testcase for PR3574.Dan Gohman2010-02-231-3/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96851 91177308-0d34-0410-b5e6-96231b3b80d8
* Instcombine constant folding can normalize gep with negative index to index ↵Evan Cheng2010-02-221-1/+31
| | | | | | with large offset. When instcombine objsize checking transformation sees these geps where the offset seemingly point out of bound, it should just return "i don't know" rather than asserting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96825 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for canonicalizing ConstantExpr operands.Dan Gohman2010-02-221-1/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96820 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant-fold certain comparisons with infinity and negative infinity.Dan Gohman2010-02-221-0/+155
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96777 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ScalarEvolution how to compute a tripcount for a loop withDan Gohman2010-02-198-12/+12
| | | | | | | | | true or false as its exit condition. These are usually eliminated by SimplifyCFG, but the may be left around during a pass which wishes to preserve the CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96683 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold bswap(undef) to undef.Dan Gohman2010-02-171-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96432 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for critical edge splitting with load PRE.Bob Wilson2010-02-161-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96385 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6305 by handling BlockAddress in a helper functionChris Lattner2010-02-151-0/+11
| | | | | | | called by jump threading. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96263 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem where we had bitcasted operands that gave usEric Christopher2010-02-131-0/+9
| | | | | | | | odd offsets since the bitcasted pointer size and the offset pointer size are going to be different types for the GEP vs base object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96134 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. modernize the constantmerge pass, using densemap/smallvector.Chris Lattner2010-02-121-10/+24
| | | | | | | | | | | 2. don't bother trying to merge globals in non-default sections, doing so is quite dubious at best anyway. 3. fix a bug reported by Arnaud de Grandmaison where we'd try to merge two globals in different address spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95995 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2010-02-121-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95993 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-1211-15/+23
| | | | | | | | | | | bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95975 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that ConstantExpr offsets also aren't off of externEric Christopher2010-02-111-0/+15
| | | | | | | | | symbols. Thanks to Duncan Sands for the testcase! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95877 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ValueRequiresCast to ShouldOptimizeCast, to better reflectChris Lattner2010-02-111-0/+16
| | | | | | | | | | | | | | | what it does. Enhance it to return false to optimizing vector sign extensions from vector comparisions, which is the idiom used to get a splatted vector for a vector comparison. Doing this breaks vector-casts.ll, add some compensating transformations to handle the important case they cover without depending on this canonicalization. This fixes rdar://7434900 a serious pessimization of vector compares. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95855 91177308-0d34-0410-b5e6-96231b3b80d8
* convert to filecheck.Chris Lattner2010-02-111-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95854 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DSE only scan blocks that are reachable from the entryChris Lattner2010-02-111-0/+14
| | | | | | | | | | block. Other blocks may have pointer cycles that will crash basicaa and other alias analyses. In any case, there is no point wasting cycles optimizing dead blocks. This fixes rdar://7635088 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95852 91177308-0d34-0410-b5e6-96231b3b80d8
* a testcase that doesn't crash GVN but could someday.Chris Lattner2010-02-111-3/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95851 91177308-0d34-0410-b5e6-96231b3b80d8
* Make jump threading honor x|undef -> true and x&undef -> false,Chris Lattner2010-02-111-0/+69
| | | | | | | instead of considering x|undef -> x, which may not be true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95850 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ConstantExpr handling to Intrinsic::objectsize lowering.Eric Christopher2010-02-111-2/+1
| | | | | | | | Update testcase accordingly now that we can optimize another section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95846 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Intrinsic::objectsize lowering back to InstCombineCalls andEric Christopher2010-02-091-3/+3
| | | | | | | enable constant 0 offset lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95691 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull these back out, they're a little too aggressive and timeEric Christopher2010-02-091-5/+5
| | | | | | | consuming for a simple optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95671 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6193, only considering sign extensions *from i1* for thisChris Lattner2010-02-091-0/+11
| | | | | | | xform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95642 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass to do llvm.objsize lowering using SCEV.Eric Christopher2010-02-091-5/+5
| | | | | | | | | | | | | Initial skeleton and SCEVUnknown lowering implemented, the rest should come relatively quickly. Move testcase to new directory. Move pass to right before SimplifyLibCalls - which is moved down a bit so we can take advantage of a few opts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95628 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for my change to disable reassociation for i1 types.Bob Wilson2010-02-061-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95465 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SimplifyCFG about magic pointer constants.Jakob Stoklund Olesen2010-02-051-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Weird code sometimes uses pointer constants other than null. This patch teaches SimplifyCFG to build switch instructions in those cases. Code like this: void f(const char *x) { if (!x) puts("null"); else if ((uintptr_t)x == 1) puts("one"); else if (x == (char*)2 || x == (char*)3) puts("two"); else if ((intptr_t)x == 4) puts("four"); else puts(x); } Now becomes a switch: define void @f(i8* %x) nounwind ssp { entry: %magicptr23 = ptrtoint i8* %x to i64 ; <i64> [#uses=1] switch i64 %magicptr23, label %if.else16 [ i64 0, label %if.then i64 1, label %if.then2 i64 2, label %if.then9 i64 3, label %if.then9 i64 4, label %if.then14 ] Note that LLVM's own DenseMap uses magic pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95439 91177308-0d34-0410-b5e6-96231b3b80d8
* fix logical-select to invoke filecheck right, and fix hte instcombineChris Lattner2010-02-051-1/+3
| | | | | | | | | | | xform it is checking to actually pass. There is no need to match m_SelectCst<0, -1> since instcombine canonicalizes that into not(sext). Add matches for sext(not(x)) in addition to not(sext(x)). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95420 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove this code for now. I have a better idea and will rewrite withEric Christopher2010-02-051-2/+13
| | | | | | | that in mind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95402 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert this since it appears to have caused a buildEric Christopher2010-02-041-12/+2
| | | | | | | failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95294 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework constant expr and array handling for objectsize instcombining.Eric Christopher2010-02-041-2/+12
| | | | | | | | | | | Fix bugs where we would compute out of bounds as in bounds, and where we couldn't know that the linker could override the size of an array. Add a few new testcases, change existing testcase to use a private global array instead of extern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95283 91177308-0d34-0410-b5e6-96231b3b80d8
* If we're dealing with a zero-length array, don't lower to anyEric Christopher2010-02-031-0/+11
| | | | | | | particular size, we just don't know what the length is yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95266 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 94937 and move the noreturn check to codegen.Evan Cheng2010-02-031-12/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95198 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit this, looks like it wasn't the cause.Eric Christopher2010-02-032-0/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95165 91177308-0d34-0410-b5e6-96231b3b80d8
* Hopefully temporarily revert this.Eric Christopher2010-02-022-42/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95154 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add strcmp and known size object size checking optimization.Eric Christopher2010-02-022-0/+42
| | | | | | | Passed bootstrap and nightly test run here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95145 91177308-0d34-0410-b5e6-96231b3b80d8
* don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : BChris Lattner2010-02-021-0/+14
| | | | | | | | for vectors. Codegen is generating awful code or segfaulting in various cases (e.g. PR6204). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95058 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash in loop unswitch on a loop invariant vector condition.Chris Lattner2010-02-021-1/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95055 91177308-0d34-0410-b5e6-96231b3b80d8
* remove an unreduced testcase, rename another.Chris Lattner2010-02-022-1697/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95054 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6195, a bug constant folding scalar -> vector compares.Chris Lattner2010-02-011-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94997 91177308-0d34-0410-b5e6-96231b3b80d8