Evan Cheng
95f51a0871
Start checking from the root of the matched sub-tree.
...
llvm-svn: 30957
2006-10-14 08:30:53 +00:00
Evan Cheng
cfb9526d61
When checking if a load can be folded, we check if there is any non-direct
...
way to reach the load via any nodes that would be folded. Start from the
root of the matched sub-tree.
llvm-svn: 30956
2006-10-14 08:30:15 +00:00
Chris Lattner
6a1b2de8c4
Make sure that the node returned by SimplifySetCC is added to the worklist
...
so that it can be deleted if unused.
llvm-svn: 30955
2006-10-14 03:52:46 +00:00
Chris Lattner
d0cc3bdfc3
testcase for recent dag combiner patch. Before the entry bb was:
...
_test:
stwu r1, -80(r1)
stw r1, 76(r1)
mflr r11
stw r11, 88(r1)
rlwinm r2, r4, 0, 30, 31
cmplwi cr7, r2, 2
mfcr r2
rlwinm r2, r2, 30, 31, 31
cmplwi cr0, r2, 0
bne cr0, LBB1_2 ;UnifiedReturnBlock
after it is:
_test:
stwu r1, -80(r1)
stw r1, 76(r1)
mflr r11
stw r11, 88(r1)
rlwinm r2, r4, 0, 30, 31
cmplwi cr0, r2, 2
bgt cr0, LBB1_2 ;UnifiedReturnBlock
llvm-svn: 30954
2006-10-14 03:40:02 +00:00
Chris Lattner
0626bd2fbc
fold setcc of a setcc.
...
llvm-svn: 30953
2006-10-14 01:02:29 +00:00
Chris Lattner
bd9acad805
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.
llvm-svn: 30952
2006-10-14 00:41:01 +00:00
Chris Lattner
47db29a405
disable this pass for now, it's causing issues
...
llvm-svn: 30951
2006-10-14 00:30:06 +00:00
Chris Lattner
3218e0eed5
falling off the end of a function is ok with an unreachable instruction.
...
llvm-svn: 30950
2006-10-14 00:21:48 +00:00
Chris Lattner
52e298b700
testcase for recent selectiondag patch
...
llvm-svn: 30949
2006-10-13 23:54:16 +00:00
Jim Laskey
dcf983ce41
Reduce the workload by not adding chain users to work list.
...
llvm-svn: 30948
2006-10-13 23:32:28 +00:00
Chris Lattner
45ffb1eb70
Fix a bug where we incorrectly turned '(X & 0) == 0' into '(X & 0) >> -1',
...
which is undefined. "0" isn't a power of 2.
llvm-svn: 30947
2006-10-13 22:46:18 +00:00
Chris Lattner
a47294ed7a
implement branch inspection/modification methods.
...
llvm-svn: 30946
2006-10-13 21:21:17 +00:00
Evan Cheng
ab51cf2e78
Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.
...
llvm-svn: 30945
2006-10-13 21:14:26 +00:00
Chris Lattner
df1ca3ff63
it is easier to implement these when they are virtual
...
llvm-svn: 30944
2006-10-13 21:02:27 +00:00
Chris Lattner
68b41e570e
allow branch reversal to fail
...
llvm-svn: 30943
2006-10-13 20:59:31 +00:00
Bill Wendling
a45a08a706
Corrected formatting.
...
llvm-svn: 30942
2006-10-13 20:53:50 +00:00
Chris Lattner
55ad08a59b
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 :)
llvm-svn: 30941
2006-10-13 20:45:56 +00:00
Chris Lattner
9516812316
replace the existing branch inspection/modification APIs with something more
...
useful and general.
llvm-svn: 30940
2006-10-13 20:44:01 +00:00
Chris Lattner
3e8e57c771
disable some objectionable code, maybe we can bring this pass to life
...
llvm-svn: 30939
2006-10-13 20:43:10 +00:00
Chris Lattner
63007919dc
remove some dead code
...
llvm-svn: 30938
2006-10-13 20:40:42 +00:00
Chris Lattner
be131662c3
add note
...
llvm-svn: 30937
2006-10-13 20:20:58 +00:00
Chris Lattner
cf56917053
set isBarrier correctly
...
llvm-svn: 30936
2006-10-13 19:10:34 +00:00
Chris Lattner
4dc4f30a48
Correctly handle instruction separators.
...
llvm-svn: 30935
2006-10-13 17:56:02 +00:00
Chris Lattner
95129a7f22
Expose method and ivars for measuring inline asm length properly.
...
llvm-svn: 30934
2006-10-13 17:50:07 +00:00
Andrew Lenharth
966645e6b4
Move some warnings to debug mode.
...
llvm-svn: 30933
2006-10-13 17:38:22 +00:00
Rafael Espindola
5ab3166f74
add FNEGS and FNEGD
...
llvm-svn: 30932
2006-10-13 17:37:35 +00:00
Chris Lattner
057083f0e7
Fix another dtor issue. The function local statics in this function were
...
being destroyed at inconvenient times. Switch to using non-local ManagedStatic
objects, which actually also speeds up ConstRules::get.
llvm-svn: 30931
2006-10-13 17:22:21 +00:00
Rafael Espindola
d6050c3149
add SBCS and SUBS
...
llvm-svn: 30930
2006-10-13 17:19:20 +00:00
Rafael Espindola
79d9807c87
implement calls to functions that return long
...
llvm-svn: 30929
2006-10-13 16:47:22 +00:00
Rafael Espindola
3874a168d0
implement unordered floating point compares
...
llvm-svn: 30928
2006-10-13 13:14:59 +00:00
Jim Laskey
ccee9baebe
Workaround for templates
...
llvm-svn: 30927
2006-10-13 13:02:19 +00:00
Jim Laskey
13d3373e72
Clean up dump.
...
llvm-svn: 30926
2006-10-13 13:01:34 +00:00
Chris Lattner
5af1cbc5cf
avoid a ctor/dtor issue with the ProgramName global.
...
llvm-svn: 30925
2006-10-13 00:06:24 +00:00
Chris Lattner
78d838186c
simplify trivial function
...
llvm-svn: 30924
2006-10-12 23:50:28 +00:00
Evan Cheng
1d04dd3aac
Really remove dead nodes from isel queue.
...
llvm-svn: 30923
2006-10-12 23:18:52 +00:00
Chris Lattner
adb19d6e8f
shrink anon-ns and mark stuff static. No functionality changes
...
llvm-svn: 30922
2006-10-12 22:09:17 +00:00
Chris Lattner
03fda13dbb
add a note
...
llvm-svn: 30921
2006-10-12 22:01:26 +00:00
Chris Lattner
d0620d2773
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.
llvm-svn: 30920
2006-10-12 20:58:32 +00:00
Chris Lattner
ce34aa8fd7
new testcase
...
llvm-svn: 30919
2006-10-12 20:56:15 +00:00
Evan Cheng
88bf1625fa
Add another cyclic dag test case.
...
llvm-svn: 30918
2006-10-12 20:38:45 +00:00
Evan Cheng
8e770f5589
Use RemoveDeadNode to kill dead node.
...
llvm-svn: 30917
2006-10-12 20:35:19 +00:00
Evan Cheng
a731cb674a
Add RemoveDeadNode to remove a dead node and its (potentially) dead operands.
...
llvm-svn: 30916
2006-10-12 20:34:05 +00:00
Chris Lattner
2e33fb453b
add a minor dag combine noticed when looking at PR945
...
llvm-svn: 30915
2006-10-12 20:23:19 +00:00
Evan Cheng
a7956d2894
Doh. This wasn't causing problems by luck.
...
llvm-svn: 30914
2006-10-12 19:13:59 +00:00
Evan Cheng
694810c227
Some X86ISD::CMP were created with wrong ValueType's.
...
llvm-svn: 30913
2006-10-12 19:12:56 +00:00
Chris Lattner
f9e946b175
Fix massive resource leaks in the bytecode reader. Reading a bytecode file
...
with ParseBytecodeFile used to leak both a ModuleProvider (and related
bytecode parser stuff attached to it) AND a file descriptor, which was
never closed. This prevented gccld/llvm-ld/llvm-link from linking together
apps with more that ~252 .bc files on darwin.
llvm-svn: 30912
2006-10-12 18:32:30 +00:00
Chris Lattner
8c9422c4b8
mark call adjustments as modifying the SP
...
llvm-svn: 30911
2006-10-12 18:00:26 +00:00
Chris Lattner
0e0ee36f45
adjcallstack up/down clobbers the sp
...
llvm-svn: 30910
2006-10-12 18:00:14 +00:00
Chris Lattner
d376e9f4ac
adjcallstackup/down clobbers the stack pointer
...
llvm-svn: 30909
2006-10-12 17:57:58 +00:00
Chris Lattner
7374bc0577
mark adjcallstack up/down as clobbering and using the SP
...
llvm-svn: 30908
2006-10-12 17:56:34 +00:00