Jim Laskey
d4edf2cf91
Tidy up after truncstore changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30961 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 12:14:27 +00:00
Evan Cheng
d42a5238a9
Debug tweak.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30959 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 08:34:06 +00:00
Chris Lattner
30f73e78bd
Make sure that the node returned by SimplifySetCC is added to the worklist
...
so that it can be deleted if unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30955 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 03:52:46 +00:00
Chris Lattner
8ac9d0ebde
fold setcc of a setcc.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30953 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 01:02:29 +00:00
Chris Lattner
51dabfb283
When SimplifySetCC was moved to the DAGCombiner, it was never removed from
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30952 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 00:41:01 +00:00
Chris Lattner
8f16eb98ed
disable this pass for now, it's causing issues
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30951 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 00:30:06 +00:00
Chris Lattner
7821a8afd3
falling off the end of a function is ok with an unreachable instruction.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30950 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-14 00:21:48 +00:00
Jim Laskey
274062c172
Reduce the workload by not adding chain users to work list.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30948 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 23:32:28 +00:00
Chris Lattner
dc78cbf457
Fix a bug where we incorrectly turned '(X & 0) == 0' into '(X & 0) >> -1',
...
which is undefined. "0" isn't a power of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30947 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 22:46:18 +00:00
Evan Cheng
8b2794aeff
Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30945 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 21:14:26 +00:00
Chris Lattner
4a84ad7a2b
add the branch folding pass as a late cleanup pass for all targets. For now
...
it just deletes empty MBB's. Soon it will do more :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30941 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 20:45:56 +00:00
Chris Lattner
eb15eeec39
disable some objectionable code, maybe we can bring this pass to life
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30939 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 20:43:10 +00:00
Jim Laskey
339ec4cb15
Workaround for templates
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30927 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 13:02:19 +00:00
Jim Laskey
774f85465e
Clean up dump.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30926 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 13:01:34 +00:00
Chris Lattner
26d2990e03
Lower X%C into X/C+stuff. This allows the 'division by a constant' logic to
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30920 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 20:58:32 +00:00
Evan Cheng
130a6471b9
Add RemoveDeadNode to remove a dead node and its (potentially) dead operands.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30916 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 20:34:05 +00:00
Chris Lattner
3657ffe037
add a minor dag combine noticed when looking at PR945
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30915 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 20:23:19 +00:00
Chris Lattner
6ec3626be4
restore my previous patch, now that the X86 backend bug has been fixed:
...
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061009/038518.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30906 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 17:45:38 +00:00
Jim Laskey
3ad175bd70
D'oh - need to use the rigth kind of store.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30903 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 15:22:24 +00:00
Evan Cheng
b870100f2a
Backing out Chris' last commit. It's breaking llvm-gcc bootstrapping.
...
It's turning:
movl -24(%ebp), %esp
subl $16, %esp
movl -24(%ebp), %ecx
into
movl -24(%ebp), %esp
subl $16, %esp
movl %esp, (%esp)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30902 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 08:00:47 +00:00
Chris Lattner
f183cabba8
If we see a load from a stack slot into a physreg, consider it as providing
...
the stack slot. This fixes PR943.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30898 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 02:34:07 +00:00
Jim Laskey
7aed46c25b
Alias analysis of TRUNCSTORE.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30889 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 18:55:16 +00:00
Jim Laskey
2d84c4c7b3
Typo
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 17:52:19 +00:00
Jim Laskey
c2b19f3449
Handle aliasing of loadext.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30883 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 17:47:52 +00:00
Jim Laskey
7ca56aff22
Fix regression in combiner alias analysis.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30880 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 13:47:09 +00:00
Evan Cheng
2e49f090f9
Naming consistency.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30878 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 07:10:22 +00:00
Andrew Lenharth
82c3d8f81a
Jimptables working again on alpha.
...
As a bonus, use the GOT node instead of the AlphaISD::GOT for internal stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30873 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 04:29:42 +00:00
Chris Lattner
755480681c
add two helper methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30869 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 03:58:02 +00:00
Evan Cheng
9629abac79
FindModifiedNodeSlot needs to add LoadSDNode ivars to create proper SelectionDAGCSEMap ID.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 01:47:58 +00:00
Evan Cheng
45aeccc1fd
Also update getNodeLabel for LoadSDNode.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30861 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-10 20:11:26 +00:00
Evan Cheng
0ac1c6ad9a
SDNode::dump should also print out extension type and VT.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30860 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-10 20:05:10 +00:00
Chris Lattner
55b5708b6b
Fix another bug in extload promotion.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30857 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-10 18:54:19 +00:00
Evan Cheng
62f2a3c7aa
Fix a bug introduced by my LOAD/LOADX changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30853 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-10 07:51:21 +00:00
Evan Cheng
466685d41a
Reflects ISD::LOAD / ISD::LOADX / LoadSDNode changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30844 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-09 20:57:25 +00:00
Chris Lattner
6270f686b3
Eliminate more token factors by taking advantage of transitivity:
...
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30821 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-08 22:57:01 +00:00
Jim Laskey
7138234baf
Combiner alias analysis passes Multisource (release-asserts.)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30818 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 23:37:56 +00:00
Chris Lattner
ed83a7019b
Fix a bug legalizing zero-extending i64 loads into 32-bit loads. The bottom
...
part was always forced to be sextload, even when we needed an zextload.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-07 00:58:36 +00:00
Chris Lattner
cf9668f23d
initialize ivar
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30780 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:52:08 +00:00
Chris Lattner
0336fdba85
If a target uses a GOT, put it in the jt data section, not the text
...
section. This will fix alpha when Andrew implements
AlphaTargetMachine::getTargetLowering().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:50:56 +00:00
Chris Lattner
e0cfc8b2f2
jump tables handle pic
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30776 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 22:32:29 +00:00
Chris Lattner
db3ea6754b
print labels even if a MBB doesn't have a corresponding LLVM BB, just don't
...
print the LLVM BB label.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30775 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 21:28:17 +00:00
Chris Lattner
4bdd2753db
Fix a miscompilation of:
...
long long foo(long long X) {
return (long long)(signed char)(int)X;
}
Instead of:
_foo:
extsb r2, r4
srawi r3, r4, 31
mr r4, r2
blr
we now produce:
_foo:
extsb r4, r4
srawi r3, r4, 31
blr
This fixes a miscompilation in ConstantFolding.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30768 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 17:34:12 +00:00
Chris Lattner
5504602836
MachineBasicBlock::splice was incorrectly updating parent pointers on
...
instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30760 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-06 01:12:44 +00:00
Evan Cheng
786225adf0
Make use of getStore().
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 23:01:46 +00:00
Evan Cheng
ad071e1cd1
Add getStore() helper function to create ISD::STORE nodes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 22:57:11 +00:00
Chris Lattner
9c78ecb511
Don't crash if an MBB doesn't have an LLVM BB
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 21:40:14 +00:00
Jim Laskey
bc588b8bbf
Alias analysis code clean ups.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 15:07:25 +00:00
Chris Lattner
e08d6e915e
Emit pic jumptables to the same section that the function is emitted to,
...
allowing label differences to work. This fixes CodeGen/X86/pic_jumptable.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30744 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:13:28 +00:00
Chris Lattner
1da31ee472
Pass the MachineFunction into EmitJumpTableInfo.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30742 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:01:21 +00:00
Chris Lattner
52f0670470
move getSectionForFunction to AsmPrinter
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:42:47 +00:00