Chris Lattner
baa47e9a6e
Revamp the ICC/FCC reading instructions to be parameterized in terms of the
...
SPARC condition codes, not in terms of the DAG condcodes. This allows us to
write nice clean patterns for cmovs/branches.
llvm-svn: 25815
2006-01-30 07:43:04 +00:00
Chris Lattner
7925da8b3b
Compile:
...
uint %test(uint %X) {
%Y = call uint %llvm.ctpop.i32(uint %X)
ret uint %Y
}
to:
test:
save -96, %o6, %o6
sll %i0, 0, %l0
popc %l0, %i0
restore %g0, %g0, %g0
retl
nop
instead of to 40 logical ops. Note the shift-by-zero that clears the top
part of the 64-bit V9 register.
Testcase here: CodeGen/SparcV8/ctpop.ll
llvm-svn: 25814
2006-01-30 06:14:02 +00:00
Chris Lattner
0551b3fcba
new testcase
...
llvm-svn: 25813
2006-01-30 06:11:36 +00:00
Chris Lattner
5583b2e227
Clear the OpAction field before setting it. This allows a target to set
...
an instruction operation action to Expand, then set it to Legal later.
llvm-svn: 25812
2006-01-30 06:09:03 +00:00
Chris Lattner
0c7df7e9d1
If the target has V9 instructions, this pass is a noop, don't bother
...
running it.
llvm-svn: 25811
2006-01-30 05:51:14 +00:00
Chris Lattner
69658ab9a8
When in v9 mode, emit fabsd/fnegd/fmovd
...
llvm-svn: 25810
2006-01-30 05:48:37 +00:00
Chris Lattner
98667e5f6a
First step towards V9 instructions in the V8 backend, two conditional move
...
patterns. This allows emission of this code:
t1:
save -96, %o6, %o6
subcc %i0, %i1, %l0
move %icc, %i0, %i2
or %g0, %i2, %i0
restore %g0, %g0, %g0
retl
nop
instead of this:
t1:
save -96, %o6, %o6
subcc %i0, %i1, %l0
be .LBBt1_2 !
nop
.LBBt1_1: !
or %g0, %i2, %i0
.LBBt1_2: !
restore %g0, %g0, %g0
retl
nop
for this:
int %t1(int %a, int %b, int %c) {
%tmp.2 = seteq int %a, %b
%tmp3 = select bool %tmp.2, int %a, int %c
ret int %tmp3
}
llvm-svn: 25809
2006-01-30 05:35:57 +00:00
Chris Lattner
8b5958a832
Two changes:
...
1. Default to having V9 instructions, instead of just V8.
2. unless -enable-sparc-v9-insts is passed, disable V9 (for use with llcbeta)
llvm-svn: 25807
2006-01-30 04:57:43 +00:00
Chris Lattner
f0ea60bc01
When lowering SELECT_CC, see if the input is a lowered SETCC. If so, fold
...
the two operations together. This allows us to compile this:
void %two(int %a, int* %b) {
%tmp.2 = seteq int %a, 0
%tmp.0.0 = select bool %tmp.2, int 10, int 20
store int %tmp.0.0, int* %b
ret void
}
into:
two:
save -96, %o6, %o6
or %g0, 20, %l0
or %g0, 10, %l1
subcc %i0, 0, %l2
be .LBBtwo_2 ! entry
nop
.LBBtwo_1: ! entry
or %g0, %l0, %l1
.LBBtwo_2: ! entry
st %l1, [%i1]
restore %g0, %g0, %g0
retl
nop
instead of:
two:
save -96, %o6, %o6
sethi 0, %l0
or %g0, 1, %l1
or %g0, 20, %l2
or %g0, 10, %l3
subcc %i0, 0, %l4
be .LBBtwo_2 ! entry
nop
.LBBtwo_1: ! entry
or %g0, %l0, %l1
.LBBtwo_2: ! entry
subcc %l1, 0, %l0
bne .LBBtwo_4 ! entry
nop
.LBBtwo_3: ! entry
or %g0, %l2, %l3
.LBBtwo_4: ! entry
st %l3, [%i1]
restore %g0, %g0, %g0
retl
nop
llvm-svn: 25806
2006-01-30 04:34:44 +00:00
Jeff Cohen
d80b0d7375
Add AddSymbol() method to DynamicLibrary to work around Windows limitation
...
of being unable to search for symbols in an EXE. It will also allow other
existing hacks to be improved.
llvm-svn: 25805
2006-01-30 04:33:51 +00:00
Chris Lattner
4ba0e38a7a
don't insert an and node if it isn't needed here, this can prevent folding
...
of lowered target nodes.
llvm-svn: 25804
2006-01-30 04:22:28 +00:00
Chris Lattner
a44182300b
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,making isMaskedValueZeroForTargetNode simpler, and useable from other partsof the compiler.
...
llvm-svn: 25803
2006-01-30 04:09:27 +00:00
Chris Lattner
a1cc69e24e
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
...
making isMaskedValueZeroForTargetNode simpler, and useable from other parts
of the compiler.
llvm-svn: 25802
2006-01-30 04:08:18 +00:00
Jeff Cohen
adacd55e5d
Add _CRT_SECURE_NO_DEPRECATE preprocessor symbol to make VS2005 happy.
...
llvm-svn: 25801
2006-01-30 04:07:08 +00:00
Chris Lattner
354340b1b1
Implement isMaskedValueZeroForTargetNode for the various v8 selectcc nodes,
...
allowing redundant and's to be eliminated by the dag combiner.
llvm-svn: 25800
2006-01-30 03:51:45 +00:00
Chris Lattner
26589d32e6
pass the address of MaskedValueIsZero into isMaskedValueZeroForTargetNode,
...
to permit recursion
llvm-svn: 25799
2006-01-30 03:49:37 +00:00
Chris Lattner
754bc1f46c
adjust prototype
...
llvm-svn: 25798
2006-01-30 03:49:07 +00:00
Chris Lattner
7f64ff5ce0
Pass the address of the main MaskedValueIsZero function to allow recursion.
...
llvm-svn: 25797
2006-01-30 03:48:36 +00:00
Chris Lattner
c97d0d1f21
fix make install/uninstall of libcrtend.
...
llvm-svn: 25796
2006-01-30 02:03:56 +00:00
Jeff Cohen
f8d118706f
Fix indentation.
...
llvm-svn: 25795
2006-01-29 22:02:52 +00:00
Chris Lattner
414a73d6f6
Fix RET of promoted values on targets that custom expand RET to a target node.
...
llvm-svn: 25794
2006-01-29 21:02:23 +00:00
Chris Lattner
2ab7f21d20
Functions that are lazily streamed in from the .bc file are *not* external.
...
This fixes llvm-test/SingleSource/UnitTests/2006-01-29-SimpleIndirectCall.c
and PR704
llvm-svn: 25793
2006-01-29 20:49:17 +00:00
Chris Lattner
b7616b85bc
simplify some code
...
llvm-svn: 25791
2006-01-29 20:01:35 +00:00
Jim Laskey
761a12ff28
Remove extra qualifier.
...
llvm-svn: 25790
2006-01-29 09:52:11 +00:00
Chris Lattner
9bb580ac23
add another note
...
llvm-svn: 25789
2006-01-29 09:46:06 +00:00
Chris Lattner
7ec490d6d6
add some performance notes from looking at sgefa
...
llvm-svn: 25788
2006-01-29 09:42:20 +00:00
Chris Lattner
7a775bff1e
add a high-priority SSE issue from sgefa
...
llvm-svn: 25787
2006-01-29 09:14:47 +00:00
Chris Lattner
7048df99cd
add a missed optimization
...
llvm-svn: 25786
2006-01-29 09:08:15 +00:00
Chris Lattner
497157db4d
cleanups to the ValueTypeActions interface
...
llvm-svn: 25785
2006-01-29 08:42:06 +00:00
Chris Lattner
4c6384a412
Now that OpActions is big enough, we can specify actions for vector types
...
llvm-svn: 25784
2006-01-29 08:41:37 +00:00
Chris Lattner
81edad23a6
clean up interface to ValueTypeActions
...
llvm-svn: 25783
2006-01-29 08:41:12 +00:00
Chris Lattner
a8ca8f5eb9
Clean up the interface to ValueTypeActions, allowing Legalize to use a copy
...
of it more cleanly. Double the size of OpActions, allowing it to hold actions
for any VT.
llvm-svn: 25782
2006-01-29 08:40:37 +00:00
Chris Lattner
488066e590
revert an accidental commit
...
llvm-svn: 25781
2006-01-29 07:59:37 +00:00
Chris Lattner
3cddcf86e0
Remove some special case hacks for CALLSEQ_*, using UpdateNodeOperands
...
instead.
llvm-svn: 25780
2006-01-29 07:58:15 +00:00
Chris Lattner
9cb1135f52
remove some methods
...
llvm-svn: 25779
2006-01-29 07:57:11 +00:00
Chris Lattner
00e9ba5526
disable this for now
...
llvm-svn: 25778
2006-01-29 07:31:33 +00:00
Reid Spencer
2669d4cb81
Add a note about lowering llvm.memset, llvm.memcpy, and llvm.memmove to a
...
few stores under certain conditions.
llvm-svn: 25777
2006-01-29 06:48:25 +00:00
Chris Lattner
73262d78b8
remove now-dead code, the legalizer takes care of this for us
...
llvm-svn: 25776
2006-01-29 06:45:31 +00:00
Chris Lattner
b66484069a
The FP stack doesn't support UNDEF, ask the legalizer to legalize it
...
instead of lying and saying we have it.
llvm-svn: 25775
2006-01-29 06:44:22 +00:00
Chris Lattner
94e9677374
Allow custom expansion of ConstantVec nodes. PPC will use this in the future.
...
llvm-svn: 25774
2006-01-29 06:34:16 +00:00
Chris Lattner
6c4173145e
Request expansion of ConstantVec nodes.
...
llvm-svn: 25773
2006-01-29 06:32:58 +00:00
Chris Lattner
3f97b9cfa3
Legalize ConstantFP into TargetConstantFP when the target allows. Implement
...
custom expansion of ConstantFP nodes.
llvm-svn: 25772
2006-01-29 06:26:56 +00:00
Chris Lattner
5f0a3df176
Targets all now request ConstantFP to be legalized into TargetConstantFP.
...
'fpimm' in .td files is now TargetConstantFP.
llvm-svn: 25771
2006-01-29 06:26:08 +00:00
Chris Lattner
ca5c2d7a4c
Update alpha to reflect recent constantfp legalize changes. It's not clear
...
why all this code isn't autogenerated. :(
llvm-svn: 25770
2006-01-29 06:25:22 +00:00
Chris Lattner
57b2492ecc
Make ConstantFP legalize into TargetConstantFP like other leaf nodes do. Allow
...
targets to register custom legalizers for ConstantFP in case there isn't a
fixed list of constants that can be generated. On some architectures (ia64?)
all fp immediates are legal.
llvm-svn: 25769
2006-01-29 06:24:40 +00:00
Chris Lattner
513942661a
remove the getBR2Way_CC method
...
llvm-svn: 25768
2006-01-29 06:01:13 +00:00
Chris Lattner
82b23c2f5c
eliminate uses of SelectionDAG::getBR2Way_CC
...
llvm-svn: 25767
2006-01-29 06:00:45 +00:00
Andrew Lenharth
1ba3cfd622
it is nice not to chop off bits for those blessed with lots of bits
...
llvm-svn: 25766
2006-01-29 05:22:37 +00:00
Andrew Lenharth
fde505e9f5
make the casts actually cast to the variable type
...
llvm-svn: 25765
2006-01-29 05:17:22 +00:00
Andrew Lenharth
896015b24f
start of the 64bit safety cleanup
...
llvm-svn: 25764
2006-01-29 05:07:04 +00:00