summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* For PR786:Reid Spencer2006-11-021-9/+5
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* Add option for controlling inclusion of global AA.Jim Laskey2006-10-181-6/+12
| | | | llvm-svn: 31040
* Use global info for alias analysis.Jim Laskey2006-10-181-9/+38
| | | | llvm-svn: 31035
* Fix CodeGen/PowerPC/2006-10-17-brcc-miscompile.llChris Lattner2006-10-171-1/+1
| | | | llvm-svn: 31019
* Make it simplier to dump DAGs while in DAGCombiner. Remove a nasty ↵Jim Laskey2006-10-171-8/+4
| | | | | | optimization. llvm-svn: 31009
* Make sure operand does have size and element type operands.Evan Cheng2006-10-171-1/+2
| | | | llvm-svn: 30999
* Be careful when looking through a vbit_convert. Optimizing this:Evan Cheng2006-10-161-2/+11
| | | | | | | | | | | (vector_shuffle (vbitconvert (vbuildvector (copyfromreg v4f32), 1, v4f32), 4, f32), (undef, undef, undef, undef), (0, 0, 0, 0), 4, f32) to the vbitconvert is a very bad idea. llvm-svn: 30989
* Pass AliasAnalysis thru to DAGCombiner.Jim Laskey2006-10-161-4/+11
| | | | llvm-svn: 30984
* Tidy up after truncstore changes.Jim Laskey2006-10-141-46/+9
| | | | llvm-svn: 30961
* Make sure that the node returned by SimplifySetCC is added to the worklistChris Lattner2006-10-141-0/+5
| | | | | | so that it can be deleted if unused. llvm-svn: 30955
* fold setcc of a setcc.Chris Lattner2006-10-141-24/+40
| | | | llvm-svn: 30953
* When SimplifySetCC was moved to the DAGCombiner, it was never removed fromChris Lattner2006-10-141-40/+8
| | | | | | | | | | SelectionDAG and it has since bitrotted. Remove the copy from SelectionDAG. Next, remove the constant folding piece of DAGCombiner::SimplifySetCC into a new FoldSetCC method which can be used by getNode() and SimplifySetCC. This fixes obscure bugs. llvm-svn: 30952
* Reduce the workload by not adding chain users to work list.Jim Laskey2006-10-131-13/+29
| | | | llvm-svn: 30948
* Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.Evan Cheng2006-10-131-42/+34
| | | | llvm-svn: 30945
* Lower X%C into X/C+stuff. This allows the 'division by a constant' logic toChris Lattner2006-10-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | apply to rems as well as divs. This fixes PR945 and speeds up ReedSolomon from 14.57s to 10.90s (which is now faster than gcc). It compiles CodeGen/X86/rem.ll into: _test1: subl $4, %esp movl %esi, (%esp) movl $2155905153, %ecx movl 8(%esp), %esi movl %esi, %eax imull %ecx addl %esi, %edx movl %edx, %eax shrl $31, %eax sarl $7, %edx addl %eax, %edx imull $255, %edx, %eax subl %eax, %esi movl %esi, %eax movl (%esp), %esi addl $4, %esp ret _test2: movl 4(%esp), %eax movl %eax, %ecx sarl $31, %ecx shrl $24, %ecx addl %eax, %ecx andl $4294967040, %ecx subl %ecx, %eax ret _test3: subl $4, %esp movl %esi, (%esp) movl $2155905153, %ecx movl 8(%esp), %esi movl %esi, %eax mull %ecx shrl $7, %edx imull $255, %edx, %eax subl %eax, %esi movl %esi, %eax movl (%esp), %esi addl $4, %esp ret instead of div/idiv instructions. llvm-svn: 30920
* add a minor dag combine noticed when looking at PR945Chris Lattner2006-10-121-0/+7
| | | | llvm-svn: 30915
* D'oh - need to use the rigth kind of store.Jim Laskey2006-10-121-3/+6
| | | | llvm-svn: 30903
* Alias analysis of TRUNCSTORE.Jim Laskey2006-10-111-1/+28
| | | | llvm-svn: 30889
* Handle aliasing of loadext.Jim Laskey2006-10-111-15/+19
| | | | llvm-svn: 30883
* Fix regression in combiner alias analysis.Jim Laskey2006-10-111-22/+33
| | | | llvm-svn: 30880
* Naming consistency.Evan Cheng2006-10-111-10/+10
| | | | llvm-svn: 30878
* Reflects ISD::LOAD / ISD::LOADX / LoadSDNode changes.Evan Cheng2006-10-091-144/+155
| | | | llvm-svn: 30844
* Eliminate more token factors by taking advantage of transitivity:Chris Lattner2006-10-081-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if TF depends on A and B, and A depends on B, TF just needs to depend on A. With Jim's alias-analysis stuff enabled, this compiles the testcase in PR892 into: __Z4test3Val: subl $44, %esp call L__Z3foov$stub movl %edx, 28(%esp) movl %eax, 32(%esp) movl %eax, 24(%esp) movl %edx, 36(%esp) movl 52(%esp), %ecx movl %ecx, 4(%esp) movl %eax, 8(%esp) movl %edx, 12(%esp) movl 48(%esp), %eax movl %eax, (%esp) call L__Z3bar3ValS_$stub addl $44, %esp ret instead of: __Z4test3Val: subl $44, %esp call L__Z3foov$stub movl %eax, 24(%esp) movl %edx, 28(%esp) movl 24(%esp), %eax movl %eax, 32(%esp) movl 28(%esp), %eax movl %eax, 36(%esp) movl 32(%esp), %eax movl 36(%esp), %ecx movl 52(%esp), %edx movl %edx, 4(%esp) movl %eax, 8(%esp) movl %ecx, 12(%esp) movl 48(%esp), %eax movl %eax, (%esp) call L__Z3bar3ValS_$stub addl $44, %esp ret llvm-svn: 30821
* Combiner alias analysis passes Multisource (release-asserts.)Jim Laskey2006-10-071-88/+71
| | | | llvm-svn: 30818
* Make use of getStore().Evan Cheng2006-10-051-8/+4
| | | | llvm-svn: 30759
* Alias analysis code clean ups.Jim Laskey2006-10-051-163/+146
| | | | llvm-svn: 30753
* More extensive alias analysis.Jim Laskey2006-10-041-201/+203
| | | | llvm-svn: 30721
* Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add anEvan Cheng2006-10-041-35/+32
| | | | | | extra operand to LOADX to specify the exact value extension type. llvm-svn: 30714
* Load chain check is not neededJim Laskey2006-09-261-24/+1
| | | | llvm-svn: 30613
* Chain can be any operandJim Laskey2006-09-261-11/+9
| | | | llvm-svn: 30611
* Wrong size for loadJim Laskey2006-09-261-2/+8
| | | | llvm-svn: 30610
* Can't move a load node if it's chain is not used.Jim Laskey2006-09-261-1/+22
| | | | llvm-svn: 30609
* Accidental enable of bad codeJim Laskey2006-09-251-1/+1
| | | | llvm-svn: 30601
* Fix chain dropping in load and drop unused stores in ret blocks.Jim Laskey2006-09-251-7/+14
| | | | llvm-svn: 30600
* Core antialiasing for load and store.Jim Laskey2006-09-251-53/+282
| | | | llvm-svn: 30597
* Make it work for DAG combine of multi-value nodes.Evan Cheng2006-09-211-2/+7
| | | | llvm-svn: 30573
* core correctionsJim Laskey2006-09-211-10/+4
| | | | llvm-svn: 30570
* Basic "in frame" alias analysis.Jim Laskey2006-09-211-2/+50
| | | | llvm-svn: 30568
* fold (aext (and (trunc x), cst)) -> (and x, cst).Chris Lattner2006-09-211-0/+15
| | | | llvm-svn: 30561
* Check the right value type. This fixes 186.crafty on x86Chris Lattner2006-09-211-1/+2
| | | | llvm-svn: 30560
* Compile:Chris Lattner2006-09-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int %test(ulong *%tmp) { %tmp = load ulong* %tmp ; <ulong> [#uses=1] %tmp.mask = shr ulong %tmp, ubyte 50 ; <ulong> [#uses=1] %tmp.mask = cast ulong %tmp.mask to ubyte %tmp2 = and ubyte %tmp.mask, 3 ; <ubyte> [#uses=1] %tmp2 = cast ubyte %tmp2 to int ; <int> [#uses=1] ret int %tmp2 } to: _test: movl 4(%esp), %eax movl 4(%eax), %eax shrl $18, %eax andl $3, %eax ret instead of: _test: movl 4(%esp), %eax movl 4(%eax), %eax shrl $18, %eax # TRUNCATE movb %al, %al andb $3, %al movzbl %al, %eax ret llvm-svn: 30558
* Generalize (zext (truncate x)) and (sext (truncate x)) folding to work whenChris Lattner2006-09-211-9/+24
| | | | | | | the src/dst are not the same size. This catches things like "truncate 32-bit X to 8 bits, then zext to 16", which happens a bit on X86. llvm-svn: 30557
* Compile:Chris Lattner2006-09-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | int test3(int a, int b) { return (a < 0) ? a : 0; } to: _test3: srawi r2, r3, 31 and r3, r2, r3 blr instead of: _test3: cmpwi cr0, r3, 1 li r2, 0 blt cr0, LBB2_2 ;entry LBB2_1: ;entry mr r3, r2 LBB2_2: ;entry blr This implements: PowerPC/select_lt0.ll:seli32_a_a llvm-svn: 30517
* Fold the full generality of (any_extend (truncate x))Chris Lattner2006-09-201-3/+9
| | | | llvm-svn: 30514
* Two things:Chris Lattner2006-09-201-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. teach SimplifySetCC that '(srl (ctlz x), 5) == 0' is really x != 0. 2. Teach visitSELECT_CC to use SimplifySetCC instead of calling it and ignoring the result. This allows us to compile: bool %test(ulong %x) { %tmp = setlt ulong %x, 4294967296 ret bool %tmp } to: _test: cntlzw r2, r3 cmplwi cr0, r3, 1 srwi r2, r2, 5 li r3, 0 beq cr0, LBB1_2 ; LBB1_1: ; mr r3, r2 LBB1_2: ; blr instead of: _test: addi r2, r3, -1 cntlzw r2, r2 cntlzw r3, r3 srwi r2, r2, 5 cmplwi cr0, r2, 0 srwi r2, r3, 5 li r3, 0 bne cr0, LBB1_2 ; LBB1_1: ; mr r3, r2 LBB1_2: ; blr This isn't wonderful, but it's an improvement. llvm-svn: 30513
* Fold (X & C1) | (Y & C2) -> (X|Y) & C3 when possible.Chris Lattner2006-09-141-0/+20
| | | | | | This implements CodeGen/X86/and-or-fold.ll llvm-svn: 30379
* Split rotate matching code out to its own function. Make it stronger, byChris Lattner2006-09-141-53/+142
| | | | | | matching things like ((x >> c1) & c2) | ((x << c3) & c4) to (rot x, c5) & c6 llvm-svn: 30376
* DAG combiner fix for rotates. Previously the outer-most condition checksEvan Cheng2006-08-311-27/+44
| | | | | | | for ROTL availability. This prevents it from forming ROTR for targets that has ROTR only. llvm-svn: 29997
* Move isCommutativeBinOp from SelectionDAG.cpp and DAGCombiner.cpp out. Make ↵Evan Cheng2006-08-291-16/+3
| | | | | | it a static method of SelectionDAG. llvm-svn: 29951
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
OpenPOWER on IntegriCloud