summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* at the end of instcombine, explicitly clear WorklistMap.Chris Lattner2007-08-051-7/+9
| | | | | | | | This shrinks it down to something small. On the testcase from PR1432, this speeds up instcombine from 0.7959s to 0.5000s, (59%) llvm-svn: 40840
* This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth2007-08-041-2/+2
| | | | | | | | LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. llvm-svn: 40807
* Replacing a cast with another one does not reduce the number of Chris Lattner2007-08-021-5/+3
| | | | | | casts in the input. llvm-svn: 40741
* Disable an xform that causes an infinite loop. This fixes PR1594Chris Lattner2007-08-021-0/+1
| | | | llvm-svn: 40739
* wrap some long lines. Major offenders that are left includeChris Lattner2007-08-021-1/+2
| | | | | | | | gvn, gvnpre, dse, and predsimplify. To see these, use: make check-line-length llvm-svn: 40738
* Enhance instcombine to be more aggressive about folding casts ofChris Lattner2007-08-021-32/+42
| | | | | | operations of casts. This implements InstCombine/zext-fold.ll llvm-svn: 40726
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-011-1/+1
| | | | | | | | indexing an empty std::vector. Updates to all clients. llvm-svn: 40660
* Fix a bug in GetKnownAlignment of packed structs.Lauro Ramos Venancio2007-07-311-3/+5
| | | | llvm-svn: 40649
* Fix a typo/thinko.Reid Spencer2007-07-301-1/+1
| | | | llvm-svn: 40599
* completely remove a transformation that is unsafe in the face ofChris Lattner2007-07-231-36/+0
| | | | | | undefs. llvm-svn: 40439
* Apply temporary work around to fix llvm mis-compilationDevang Patel2007-07-211-1/+3
| | | | | | reported in PR 1556. llvm-svn: 40133
* this xform is already done by the constant folder.Chris Lattner2007-07-201-6/+1
| | | | llvm-svn: 40124
* Optimize alignment of loads and stores.Dan Gohman2007-07-201-0/+10
| | | | llvm-svn: 40102
* Fix comments about vectors to use the current wording.Dan Gohman2007-07-161-5/+5
| | | | llvm-svn: 39921
* Repair a regression in Transforms/InstCombine/mul.ll that Reid noticed.Chris Lattner2007-07-161-0/+13
| | | | llvm-svn: 39896
* Implement shift-simplify.ll:test[45].Chris Lattner2007-07-151-11/+23
| | | | | | | | | | | First teach instcombine that sign bit checks only demand the sign bit, this allows simplify demanded bits to hack on expressions better. Second, teach instcombine that ashr is useless if only the sign bit is demanded. llvm-svn: 39880
* Implement shift-simplify.ll:test3, turning:Chris Lattner2007-07-151-103/+116
| | | | | | | | (X << 31) <s 0 --> (X&1) != 0 This happens dozens of times in the CFE. llvm-svn: 39879
* Significantly improve the documentation of the instcombine divide/compareChris Lattner2007-06-211-35/+51
| | | | | | | | transformation. Also, keep track of which end of the integer interval overflows occur on. This fixes Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll and rdar://5278853, a miscompilation of perl. llvm-svn: 37692
* refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its ownChris Lattner2007-06-201-123/+134
| | | | | | routine. llvm-svn: 37679
* silence a bogus warning Duraid ran into.Chris Lattner2007-06-191-1/+1
| | | | llvm-svn: 37649
* Generalize many transforms to work on ~ of vectors in addition to ~ ofChris Lattner2007-06-151-29/+31
| | | | | | | integer ops. This implements Transforms/InstCombine/and-or-not.ll test3/test4, and finishes off PR1510 llvm-svn: 37589
* Implement two xforms:Chris Lattner2007-06-151-6/+26
| | | | | | | | | | | 1. ~(~X | Y) === (X & ~Y) 2. (A|B) & ~(A&B) -> A^B This allows us to transform ~(~(a|b) | (a&b)) -> a^b. This implements PR1510 for scalar values. llvm-svn: 37584
* delete some obviously dead vector operations, which deletes a few thousandChris Lattner2007-06-151-1/+12
| | | | | | operations from Duraids example. llvm-svn: 37582
* Fix PR1499.Lauro Ramos Venancio2007-06-061-0/+4
| | | | llvm-svn: 37472
* fix a miscompilation when passing a float through varargsChris Lattner2007-05-231-2/+1
| | | | llvm-svn: 37297
* Fix Transforms/InstCombine/2007-05-18-CastFoldBug.ll, a bug that devastatesChris Lattner2007-05-191-0/+8
| | | | | | objc code due to the way the FE lowers objc message sends. llvm-svn: 37256
* Fix Transforms/InstCombine/2007-05-14-Crash.llChris Lattner2007-05-151-7/+16
| | | | llvm-svn: 37057
* Fix typos.Dan Gohman2007-05-111-1/+1
| | | | llvm-svn: 36994
* fix regressions from my previous checking, includingChris Lattner2007-05-111-2/+2
| | | | | | Transforms/InstCombine/2006-12-08-ICmp-Combining.ll llvm-svn: 36989
* fix Transforms/InstCombine/2007-05-10-icmp-or.llChris Lattner2007-05-111-5/+10
| | | | llvm-svn: 36984
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
* Fix a bug in my previous patchChris Lattner2007-05-061-1/+1
| | | | llvm-svn: 36857
* Implement Transforms/InstCombine/cast_ptr.llChris Lattner2007-05-051-1/+22
| | | | llvm-svn: 36809
* wrap long linesChris Lattner2007-05-051-8/+8
| | | | llvm-svn: 36807
* Fix InstCombine/2007-05-04-Crash.ll and PR1384Chris Lattner2007-05-051-10/+14
| | | | llvm-svn: 36775
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | llvm-svn: 36632
* fix a bug triggered by 403.gccChris Lattner2007-04-281-2/+1
| | | | llvm-svn: 36527
* Fix several latent bugs in EmitGEPOffset that didn't manifest with itsChris Lattner2007-04-281-36/+52
| | | | | | previous clients. This fixes MallocBench/gs llvm-svn: 36525
* uhn zap cvsChris Lattner2007-04-281-6/+0
| | | | llvm-svn: 36523
* Implement PR1345 and Transforms/InstCombine/bitcast-gep.llChris Lattner2007-04-281-28/+104
| | | | llvm-svn: 36521
* refactor some code relating to pointer cast xforms, pulling it out of the ↵Chris Lattner2007-04-271-53/+56
| | | | | | | | codepath for unrelated casts. llvm-svn: 36511
* Make use of ConstantInt::isZero instead of ConstantInt::isNullValue.Zhou Sheng2007-04-191-4/+4
| | | | llvm-svn: 36261
* Extend store merging to support the 'if/then' version in addition to ↵Chris Lattner2007-04-151-26/+60
| | | | | | | | | | | | | | | | | | | | if/then/else. This sinks the two stores in this example into a single store in cond_next. In this case, it allows elimination of the load as well: store double 0.000000e+00, double* @s.3060 %tmp3 = fcmp ogt double %tmp1, 5.000000e-01 ; <i1> [#uses=1] br i1 %tmp3, label %cond_true, label %cond_next cond_true: ; preds = %entry store double 1.000000e+00, double* @s.3060 br label %cond_next cond_next: ; preds = %entry, %cond_true %tmp6 = load double* @s.3060 ; <double> [#uses=1] This implements Transforms/InstCombine/store-merge.ll:test2 llvm-svn: 36040
* refactor some code, no functionality change.Chris Lattner2007-04-151-58/+77
| | | | llvm-svn: 36037
* fix long linesChris Lattner2007-04-141-8/+9
| | | | llvm-svn: 36031
* Implement Transforms/InstCombine/vec_extract_elt.ll, transforming:Chris Lattner2007-04-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | define i32 @test(float %f) { %tmp7 = insertelement <4 x float> undef, float %f, i32 0 %tmp17 = bitcast <4 x float> %tmp7 to <4 x i32> %tmp19 = extractelement <4 x i32> %tmp17, i32 0 ret i32 %tmp19 } into: define i32 @test(float %f) { %tmp19 = bitcast float %f to i32 ; <i32> [#uses=1] ret i32 %tmp19 } On PPC, this is the difference between: _test: mfspr r2, 256 oris r3, r2, 8192 mtspr 256, r3 stfs f1, -16(r1) addi r3, r1, -16 addi r4, r1, -32 lvx v2, 0, r3 stvx v2, 0, r4 lwz r3, -32(r1) mtspr 256, r2 blr and: _test: stfs f1, -4(r1) nop nop nop lwz r3, -4(r1) blr llvm-svn: 36025
* Implement InstCombine/vec_demanded_elts.ll:test2. This allows us to turnChris Lattner2007-04-141-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unsigned test(float f) { return _mm_cvtsi128_si32( (__m128i) _mm_set_ss( f*f )); } into: _test: movss 4(%esp), %xmm0 mulss %xmm0, %xmm0 movd %xmm0, %eax ret instead of: _test: movss 4(%esp), %xmm0 mulss %xmm0, %xmm0 xorps %xmm1, %xmm1 movss %xmm0, %xmm1 movd %xmm1, %eax ret GCC gets: _test: subl $28, %esp movss 32(%esp), %xmm0 mulss %xmm0, %xmm0 xorps %xmm1, %xmm1 movss %xmm0, %xmm1 movaps %xmm1, %xmm0 movd %xmm0, 12(%esp) movl 12(%esp), %eax addl $28, %esp ret llvm-svn: 36020
* Implement PR1201 and test/Transforms/InstCombine/malloc-free-delete.llChris Lattner2007-04-141-8/+23
| | | | llvm-svn: 35981
OpenPOWER on IntegriCloud