summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
Commit message (Collapse)AuthorAgeFilesLines
* Convert to the new EH model.Bill Wendling2011-11-081-10/+5
| | | | llvm-svn: 144050
* Make sure we use the right insertion point when instcombine replaces a PHI ↵Eli Friedman2011-11-011-0/+25
| | | | | | with another instruction. (Specifically, don't insert an arbitrary instruction before a PHI.) Fixes PR11275. llvm-svn: 143437
* Extend instcombine's shufflevector simplification to handle more cases where ↵Eli Friedman2011-10-211-0/+46
| | | | | | the input and output vectors have different sizes. Patch by Xiaoyi Guo. llvm-svn: 142671
* Add support for the Objective-C personality function to the instructionBill Wendling2011-10-171-0/+52
| | | | | | | | combining of the landingpad instruction. The ObjC personality function acts almost identically to the C++ personality function. In particular, it uses "null" as a "catch-all" value. llvm-svn: 142256
* Add a routine to swap branch instruction operands, and update anyChandler Carruth2011-10-171-3/+28
| | | | | | | | | | | | profile metadata at the same time. Use it to preserve metadata attached to a branch when re-writing it in InstCombine. Add metadata to the canonicalize_branch InstCombine test, and check that it is tranformed correctly. Reviewed by Nick Lewycky! llvm-svn: 142168
* Added a testcase for r141599, rdar://problem/10063881.Lang Hames2011-10-111-0/+20
| | | | llvm-svn: 141628
* Revert 141203. InstCombine is looping on unit tests.Jim Grosbach2011-10-051-2/+2
| | | | llvm-svn: 141209
* Update InstCombine worklist after instruction transform is complete.Jim Grosbach2011-10-051-2/+2
| | | | | | | | | | | | When updating the worklist for InstCombine, the Add/AddUsersToWorklist functions may access the instruction(s) being added, for debug output for example. If the instructions aren't yet added to the basic block, this can result in a crash. Finish the instruction transformation before adjusting the worklist instead. rdar://10238555 llvm-svn: 141203
* Add a new icmp+select optz'n. Also shows off the load(cst) folding added inNick Lewycky2011-10-021-0/+10
| | | | | | r140966. llvm-svn: 140969
* float comparison to double 'zero' constant can just be a float 'zero.'Jim Grosbach2011-09-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | InstCombine was incorrectly considering the conversion of the constant zero to be unsafe. We want to transform: define float @bar(float %x) nounwind readnone optsize ssp { %conv = fpext float %x to double %cmp = fcmp olt double %conv, 0.000000e+00 %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } Into: define float @bar(float %x) nounwind readnone optsize ssp { %cmp = fcmp olt float %x, 0.000000e+00 ; <---- This %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } rdar://10215914 llvm-svn: 140869
* Add forgotten tests that the cleanup flag is cleared if thereDuncan Sands2011-09-301-0/+24
| | | | | | is a catch-all landingpad clause. llvm-svn: 140858
* Inlining often produces landingpad instructions with repeatedDuncan Sands2011-09-301-0/+157
| | | | | | | | | | | | | | catch or repeated filter clauses. Teach instcombine a bunch of tricks for simplifying landingpad clauses. Currently the code only recognizes the GNU C++ and Ada personality functions, but that doesn't stop it doing a bunch of "generic" transforms which are hopefully fine for any real-world personality function. If these "generic" transforms turn out not to be generic, they can always be conditioned on the personality function. Probably someone should add the ObjC++ personality function. I didn't as I don't know anything about it. llvm-svn: 140852
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-273-16/+16
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* Fix an infinite loop where a transform in InstCombiner::visitAnd claims a ↵Eli Friedman2011-09-191-0/+7
| | | | | | | | construct is changed when it is not. (See included testcase.) Patch by Xiaoyi Guo. llvm-svn: 140072
* Make demanded-elt simplification for shufflevector slightly stronger. ↵Eli Friedman2011-09-151-0/+11
| | | | | | Spotted by inspection. llvm-svn: 139768
* Forgot to add this trampoline testcase.Duncan Sands2011-09-071-0/+87
| | | | llvm-svn: 139229
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-061-2/+4
| | | | | | | | | | | | | | | | | | | | init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. llvm-svn: 139140
* Update to new EH scheme.Bill Wendling2011-09-014-0/+14
| | | | llvm-svn: 138933
* Fixes following the CR by Chris and Duncan:Nadav Rotem2011-08-291-3/+36
| | | | | | | Optimize chained bitcasts of the form A->B->A. Undo r138722 and change isEliminableCastPair to allow this case. llvm-svn: 138756
* Bitcasts are transitive. Bitcast-Bitcast-X becomes Bitcast-X.Nadav Rotem2011-08-281-0/+14
| | | | llvm-svn: 138722
* Auto upgrade the old EH scheme to use the new one. This is on a trial basis. IfBill Wendling2011-08-271-0/+4
| | | | | | things to disasterously over night, this can be reverted. llvm-svn: 138702
* Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.Nadav Rotem2011-08-241-5/+29
| | | | llvm-svn: 138469
* Revert "Address Duncan's CR request:"Eric Christopher2011-08-231-29/+5
| | | | | | | | | | This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340) Conflicts: test/Transforms/InstCombine/bitcast.ll llvm-svn: 138366
* Fix a typo in the test from the previous commit.Nadav Rotem2011-08-231-3/+3
| | | | llvm-svn: 138342
* Address Duncan's CR request:Nadav Rotem2011-08-231-0/+24
| | | | | | | 1. Cleanup the tests in ConstantFolding.cpp 2. Implement isAllOnes for Constant, ConstantFP, ConstantVector llvm-svn: 138340
* Add constant folding support for bitcasts of splat vectors to integers.Nadav Rotem2011-08-201-0/+10
| | | | llvm-svn: 138206
* An additional atomic test; related to r137662.Eli Friedman2011-08-161-0/+9
| | | | llvm-svn: 137786
* Migrate this test from llvm/test/FrontendC++/ptr-to-method-devirt.cpp andEric Christopher2011-08-161-0/+39
| | | | | | FileCheckize. It is more properly an optimizer test. llvm-svn: 137700
* Update instcombine for atomic load/store.Eli Friedman2011-08-151-0/+15
| | | | llvm-svn: 137664
* This transform is not safe. Thanks to Eli for pointing that out!Nick Lewycky2011-08-141-10/+10
| | | | llvm-svn: 137575
* Don't attempt to add 'nsw' when intermediate instructions had no such guarantee.Nick Lewycky2011-08-141-1/+29
| | | | llvm-svn: 137572
* Teach instcombine to preserve the nsw bit by doing an after-the-fact analysisNick Lewycky2011-08-141-0/+16
| | | | | | when combining add and sub instructions. Patch by Pranav Bhandarkar! llvm-svn: 137570
* Move "atomic" and "volatile" designations on instructions after the opcodeEli Friedman2011-08-127-13/+13
| | | | | | | | | | of the instruction. Note that this change affects the existing non-atomic load and store instructions; the parser now accepts both forms, and the change is noted in the release notes. llvm-svn: 137527
* Fix logical error when detecting lifetime intrinsics.Nick Lewycky2011-08-031-0/+11
| | | | | | | | | Don't replace a gep/bitcast with 'undef' because that will form a "free(undef)" which in turn means "unreachable". What we wanted was a no-op. Instead, analyze the whole tree and look for all the instructions we need to delete first, then delete them second, not relying on the use_list to stay consistent. llvm-svn: 136752
* Teach InstCombine that lifetime intrincs aren't a real user on the result of aNick Lewycky2011-08-021-1/+13
| | | | | | malloc call. llvm-svn: 136732
* Lifetime intrinsics on undef are dead.Nick Lewycky2011-08-021-1/+10
| | | | llvm-svn: 136722
* Add a small gep optimization I noticed was missing while reading some IL.Rafael Espindola2011-07-311-0/+20
| | | | llvm-svn: 136585
* Make sure to correctly clear the exact/nuw/nsw flags off of shifts when they ↵Eli Friedman2011-07-291-2/+17
| | | | | | are combined together. <rdar://problem/9859829> llvm-svn: 136435
* 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-095-42/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* PR10180: Fix a instcombine crash with FP vectors.Eli Friedman2011-06-231-0/+12
| | | | llvm-svn: 133756
* rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which isChris Lattner2011-06-188-335/+284
| | | | | | | | | 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
* 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-173-7/+0
| | | | | | | | been needed since llvm-gcc 3.4 days. llvm-svn: 133248
* remove parser support for the obsolete "multiple return values" syntax, whichChris Lattner2011-06-171-11/+0
| | | | | | was replaced with return of a "first class aggregate". llvm-svn: 133245
* Remove support for using "foo" as symbols instead of %"foo". This is ancientChris Lattner2011-06-171-2/+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-1714-114/+13
| | | | | | are either unreduced or only test old syntax. llvm-svn: 133228
OpenPOWER on IntegriCloud