Chris Lattner [Thu, 2 Feb 2006 07:17:31 +0000 (07:17 +0000)]
Turn any_extend nodes into zero_extend nodes when it allows us to remove an
and instruction. This allows us to compile stuff like this:
bool %X(int %X) {
%Y = add int %X, 14
%Z = setne int %Y, 12345
ret bool %Z
}
to this:
_X:
cmpl $12331, 4(%esp)
setne %al
movzbl %al, %eax
ret
instead of this:
_X:
cmpl $12331, 4(%esp)
setne %al
movzbl %al, %eax
andl $1, %eax
ret
This occurs quite a bit with the X86 backend. For example, 25 times in
lambda, 30 times in 177.mesa, 14 times in galgel, 70 times in fma3d,
25 times in vpr, several hundred times in gcc, ~45 times in crafty,
~60 times in parser, ~140 times in eon, 110 times in perlbmk, 55 on gap,
16 times on bzip2, 14 times on twolf, and 1-2 times in many other SPEC2K
programs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25901
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 06:43:15 +0000 (06:43 +0000)]
Implement MaskedValueIsZero for ANY_EXTEND nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25900
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 06:36:48 +0000 (06:36 +0000)]
implemented, testcase here: test/Regression/CodeGen/X86/compare-add.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25899
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 06:36:13 +0000 (06:36 +0000)]
add two dag combines:
(C1-X) == C2 --> X == C1-C2
(X+C1) == C2 --> X == C2-C1
This allows us to compile this:
bool %X(int %X) {
%Y = add int %X, 14
%Z = setne int %Y, 12345
ret bool %Z
}
into this:
_X:
cmpl $12331, 4(%esp)
setne %al
movzbl %al, %eax
andl $1, %eax
ret
not this:
_X:
movl $14, %eax
addl 4(%esp), %eax
cmpl $12345, %eax
setne %al
movzbl %al, %eax
andl $1, %eax
ret
Testcase here: Regression/CodeGen/X86/compare-add.ll
nukage of the and coming up next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25898
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 06:35:38 +0000 (06:35 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25897
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 2 Feb 2006 02:40:17 +0000 (02:40 +0000)]
Update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25896
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 00:38:08 +0000 (00:38 +0000)]
make -debug output less newliney
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25895
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 2 Feb 2006 00:28:23 +0000 (00:28 +0000)]
Fix a erroneous comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25894
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 00:25:23 +0000 (00:25 +0000)]
Implement matching constraints. We can now say things like this:
%C = call int asm "xyz $0, $1, $2, $3", "=r,r,r,0"(int %A, int %B, int 4)
and get:
xyz r2, r3, r4, r2
note that the r2's are pinned together. Yaay for 2-address instructions.
2342 ----------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25893
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 00:23:53 +0000 (00:23 +0000)]
validate matching constraints and remember when we see them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25892
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 00:23:12 +0000 (00:23 +0000)]
add an instance var and argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25891
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 23:38:08 +0000 (23:38 +0000)]
more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25890
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 23:03:16 +0000 (23:03 +0000)]
Tell codegen MOVAPSrr and MOVAPDrr are copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25889
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 23:02:25 +0000 (23:02 +0000)]
Added SSE entries to foldMemoryOperand().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25888
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 23:01:57 +0000 (23:01 +0000)]
Rearrange code to my liking. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25887
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 22:41:11 +0000 (22:41 +0000)]
Implement smart printing of inline asm strings, handling variants and
substituted operands. For this testcase:
int %test(int %A, int %B) {
%C = call int asm "xyz $0, $1, $2", "=r,r,r"(int %A, int %B)
ret int %C
}
we now emit:
_test:
or r2, r3, r3
or r3, r4, r4
xyz r2, r2, r3 ;; look here
or r3, r2, r2
blr
... note the substituted operands. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25886
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 22:39:30 +0000 (22:39 +0000)]
add a new PrintAsmOperand method, move some stuff around for ease of reading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25885
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 22:38:46 +0000 (22:38 +0000)]
add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25884
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 21:44:48 +0000 (21:44 +0000)]
another note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25883
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 1 Feb 2006 19:37:33 +0000 (19:37 +0000)]
Add immediate forms of cmov and remove some cruft
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25882
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 1 Feb 2006 19:36:52 +0000 (19:36 +0000)]
test cmov immediate form
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25881
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 19:12:23 +0000 (19:12 +0000)]
add a note, ya knoe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25880
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Wed, 1 Feb 2006 19:05:15 +0000 (19:05 +0000)]
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25879
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 18:59:47 +0000 (18:59 +0000)]
Implement simple register assignment for inline asms. This allows us to compile:
int %test(int %A, int %B) {
%C = call int asm "xyz $0, $1, $2", "=r,r,r"(int %A, int %B)
ret int %C
}
into:
(0x8906130, LLVM BB @0x8902220):
%r2 = OR4 %r3, %r3
%r3 = OR4 %r4, %r4
INLINEASM <es:xyz $0, $1, $2>, %r2<def>, %r2, %r3
%r3 = OR4 %r2, %r2
BLR
which asmprints as:
_test:
or r2, r3, r3
or r3, r4, r4
xyz $0, $1, $2 ;; need to print the operands now :)
or r3, r2, r2
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25878
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 18:10:56 +0000 (18:10 +0000)]
Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25877
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 17:54:23 +0000 (17:54 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25876
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Wed, 1 Feb 2006 07:19:44 +0000 (07:19 +0000)]
Fix some of the stuff in the PPC README file, and clean up legalization
of the SELECT_CC, BR_CC, and BRTWOWAY_CC nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25875
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 06:40:32 +0000 (06:40 +0000)]
add a note, I'll take care of this after nate commits his big patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25873
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 06:13:50 +0000 (06:13 +0000)]
- Use xor to clear integer registers (set R, 0).
- Added a new format for instructions where the source register is implied
and it is same as the destination register. Used for pseudo instructions
that clear the destination register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25872
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 06:08:48 +0000 (06:08 +0000)]
Remove another entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25871
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 06:06:31 +0000 (06:06 +0000)]
If a pattern's root node is a constant, its size should be 3 rather than 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25870
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Wed, 1 Feb 2006 04:37:04 +0000 (04:37 +0000)]
Fix VC++ compilation error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25869
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 01:45:02 +0000 (01:45 +0000)]
new testcase for the 'ret double folding with load' opzn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25868
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 01:44:25 +0000 (01:44 +0000)]
Another regression from the pattern isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25867
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 01:29:47 +0000 (01:29 +0000)]
Beef up the interface to inline asm constraint parsing, making it more general, useful, and easier to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25866
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 01:28:23 +0000 (01:28 +0000)]
adjust to changes in InlineAsm interface. Fix a few minor bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25865
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 01:27:37 +0000 (01:27 +0000)]
Beef up the interface to inline asm constraint parsing, making it more
general, useful, and easier to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25864
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 01:19:32 +0000 (01:19 +0000)]
Return's chain should be matching either the chain produced by the
value or the chain going into the load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25863
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 1 Feb 2006 00:28:12 +0000 (00:28 +0000)]
another testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25862
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 00:20:21 +0000 (00:20 +0000)]
When folding a load into a return of SSE value, check the chain to
ensure the memory location has not been clobbered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25861
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 1 Feb 2006 00:15:53 +0000 (00:15 +0000)]
Remove an item. It's done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25860
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 23:19:54 +0000 (23:19 +0000)]
Be smarter about whether to store the SSE return value in memory. If
it is already available in memory, do a fld directly from there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25859
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 22:59:46 +0000 (22:59 +0000)]
turning these into 'adds' would require extra copies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25858
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 22:28:30 +0000 (22:28 +0000)]
- Allow XMM load (for scalar use) to be folded into ANDP* and XORP*.
- Use XORP* to implement fneg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25857
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 22:26:21 +0000 (22:26 +0000)]
Remove entries on fabs and fneg. These are done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25856
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 22:23:14 +0000 (22:23 +0000)]
Allow the specification of explicit alignments for constant pool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25855
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 19:43:35 +0000 (19:43 +0000)]
* Fix 80-column violations
* Rename hasSSE -> hasSSE1 to avoid my continual confusion with 'has any SSE'.
* Add inline asm constraint specification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25854
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 19:20:21 +0000 (19:20 +0000)]
add info about the inline asm register constraints for PPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25853
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 18:14:25 +0000 (18:14 +0000)]
Allow custom lowering of fabs. I forgot to check in this change which
caused several test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25852
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 17:20:06 +0000 (17:20 +0000)]
add a missing break that caused a lot of failures last night :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25851
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 16:10:53 +0000 (16:10 +0000)]
solaris won't clobber an existing symlink with ln -sf apparently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25849
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Tue, 31 Jan 2006 08:17:29 +0000 (08:17 +0000)]
Codegen
bool %test(int %X) {
%Y = seteq int %X, 13
ret bool %Y
}
as
_test:
addi r2, r3, -13
cntlzw r2, r2
srwi r3, r2, 5
blr
rather than
_test:
cmpwi cr7, r3, 13
mfcr r2
rlwinm r3, r2, 31, 31, 31
blr
This has very little effect on most code, but speeds up analyzer 23% and
mason 11%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25848
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:45:45 +0000 (07:45 +0000)]
okay, one more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25847
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:45:08 +0000 (07:45 +0000)]
another note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25846
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:43:33 +0000 (07:43 +0000)]
More notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25845
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:38:32 +0000 (07:38 +0000)]
another one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25844
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:37:20 +0000 (07:37 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25843
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:26:55 +0000 (07:26 +0000)]
add conditional moves of float and double values on int/fp condition codes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25842
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 07:16:34 +0000 (07:16 +0000)]
example nate pointed out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25841
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:56:30 +0000 (06:56 +0000)]
treat conditional branches the same way as conditional moves (giving them
an operand that contains the condcode), making things significantly simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25840
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:49:09 +0000 (06:49 +0000)]
compactify all of the integer conditional moves into one instruction that takes
a CC as an operand. Much smaller, much happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25839
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:24:29 +0000 (06:24 +0000)]
Add immediate forms of integer cmovs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25838
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:18:16 +0000 (06:18 +0000)]
Shrinkify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25837
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:02:35 +0000 (06:02 +0000)]
implement test/Regression/TableGen/DagIntSubst.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25836
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 06:01:40 +0000 (06:01 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25835
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 05:26:36 +0000 (05:26 +0000)]
Add the full complement of conditional moves of integer registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25834
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 05:05:52 +0000 (05:05 +0000)]
Compile this:
void %X(int %A) {
%C = setlt int %A, 123 ; <bool> [#uses=1]
br bool %C, label %T, label %F
T: ; preds = %0
call int %main( int 0 ) ; <int>:0 [#uses=0]
ret void
F: ; preds = %0
ret void
}
to this:
X:
save -96, %o6, %o6
subcc %i0, 122, %l0
bg .LBBX_2 ! F
nop
...
not this:
X:
save -96, %o6, %o6
sethi 0, %l0
or %g0, 1, %l1
subcc %i0, 122, %l2
bg .LBBX_4 !
nop
.LBBX_3: !
or %g0, %l0, %l1
.LBBX_4: !
subcc %l1, 0, %l0
bne .LBBX_2 ! F
nop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25833
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 05:04:52 +0000 (05:04 +0000)]
Only insert an AND when converting from BR_COND to BRCC if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25832
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 31 Jan 2006 03:14:29 +0000 (03:14 +0000)]
Added custom lowering of fabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25831
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 02:55:28 +0000 (02:55 +0000)]
add the 'lucas' optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25830
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 02:45:52 +0000 (02:45 +0000)]
I don't see why this optimization isn't safe, but it isn't, so disable it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25829
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 02:10:06 +0000 (02:10 +0000)]
Another high-prio selection performance bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25828
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 02:03:41 +0000 (02:03 +0000)]
Handle physreg input/outputs. We now compile this:
int %test_cpuid(int %op) {
%B = alloca int
%C = alloca int
%D = alloca int
%A = call int asm "cpuid", "=eax,==ebx,==ecx,==edx,eax"(int* %B, int* %C, int* %D, int %op)
%Bv = load int* %B
%Cv = load int* %C
%Dv = load int* %D
%x = add int %A, %Bv
%y = add int %x, %Cv
%z = add int %y, %Dv
ret int %z
}
to this:
_test_cpuid:
sub %ESP, 16
mov DWORD PTR [%ESP], %EBX
mov %EAX, DWORD PTR [%ESP + 20]
cpuid
mov DWORD PTR [%ESP + 8], %ECX
mov DWORD PTR [%ESP + 12], %EBX
mov DWORD PTR [%ESP + 4], %EDX
mov %ECX, DWORD PTR [%ESP + 12]
add %EAX, %ECX
mov %ECX, DWORD PTR [%ESP + 8]
add %EAX, %ECX
mov %ECX, DWORD PTR [%ESP + 4]
add %EAX, %ECX
mov %EBX, DWORD PTR [%ESP]
add %ESP, 16
ret
... note the proper register allocation. :)
it is unclear to me why the loads aren't folded into the adds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25827
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 00:45:37 +0000 (00:45 +0000)]
more mumbling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25826
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 31 Jan 2006 00:20:38 +0000 (00:20 +0000)]
add some notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25825
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 30 Jan 2006 23:41:35 +0000 (23:41 +0000)]
Don't generate complex sequence for SETOLE, SETOLT, SETULT, and SETUGT. Flip
the order of the compare operands and generate SETOGT, SETOGE, SETUGE, and
SETULE instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25824
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 30 Jan 2006 23:39:40 +0000 (23:39 +0000)]
Don't generate (or setp, setae) for SETUGE. Simply flip the operands around and
generate SETULT instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25823
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 23:00:08 +0000 (23:00 +0000)]
Print the most trivial inline asms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25822
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 22:43:50 +0000 (22:43 +0000)]
Fix a bug in my legalizer reworking that caused the X86 backend to not get
a chance to custom legalize setcc, which broke a bunch of C++ Codes.
Testcase here: CodeGen/X86/2006-01-30-LongSetcc.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25821
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 22:43:10 +0000 (22:43 +0000)]
new testcase for the 'C++' failures last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25820
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 22:20:49 +0000 (22:20 +0000)]
Fix FP constants, and the SparcV8/2006-01-22-BitConvertLegalize.ll failure from last night
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25819
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 30 Jan 2006 22:13:22 +0000 (22:13 +0000)]
i64 -> f32, f32 -> i64 and some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25818
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 30 Jan 2006 08:02:57 +0000 (08:02 +0000)]
Always use FP stack instructions to perform i64 to f64 as well as f64 to i64
conversions. SSE does not have instructions to handle these tasks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25817
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 30 Jan 2006 07:47:47 +0000 (07:47 +0000)]
One more getTargetNode() variant shouldn't hurt...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25816
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 07:43:04 +0000 (07:43 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25815
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 06:14:02 +0000 (06:14 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25814
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 06:11:36 +0000 (06:11 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25813
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 06:09:03 +0000 (06:09 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25812
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 05:51:14 +0000 (05:51 +0000)]
If the target has V9 instructions, this pass is a noop, don't bother
running it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25811
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 05:48:37 +0000 (05:48 +0000)]
When in v9 mode, emit fabsd/fnegd/fmovd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25810
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 05:35:57 +0000 (05:35 +0000)]
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
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25809
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 04:57:43 +0000 (04:57 +0000)]
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25807
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 04:34:44 +0000 (04:34 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25806
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Mon, 30 Jan 2006 04:33:51 +0000 (04:33 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25805
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 04:22:28 +0000 (04:22 +0000)]
don't insert an and node if it isn't needed here, this can prevent folding
of lowered target nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25804
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 04:09:27 +0000 (04:09 +0000)]
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,making isMaskedValueZeroForTargetNode simpler, and useable from other partsof the compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25803
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 04:08:18 +0000 (04:08 +0000)]
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
making isMaskedValueZeroForTargetNode simpler, and useable from other parts
of the compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25802
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Mon, 30 Jan 2006 04:07:08 +0000 (04:07 +0000)]
Add _CRT_SECURE_NO_DEPRECATE preprocessor symbol to make VS2005 happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25801
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 03:51:45 +0000 (03:51 +0000)]
Implement isMaskedValueZeroForTargetNode for the various v8 selectcc nodes,
allowing redundant and's to be eliminated by the dag combiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25800
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 30 Jan 2006 03:49:37 +0000 (03:49 +0000)]
pass the address of MaskedValueIsZero into isMaskedValueZeroForTargetNode,
to permit recursion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25799
91177308-0d34-0410-b5e6-
96231b3b80d8