Benjamin Kramer
6020ed9d99
X86: Lower a select directly to a setcc_carry if possible.
...
int test(unsigned long a, unsigned long b) { return -(a < b); }
compiles to
_test: ## @test
cmpq %rsi, %rdi ## encoding: [0x48,0x39,0xf7]
sbbl %eax, %eax ## encoding: [0x19,0xc0]
ret ## encoding: [0xc3]
instead of
_test: ## @test
xorl %ecx, %ecx ## encoding: [0x31,0xc9]
cmpq %rsi, %rdi ## encoding: [0x48,0x39,0xf7]
movl $-1, %eax ## encoding: [0xb8,0xff,0xff,0xff,0xff]
cmovael %ecx, %eax ## encoding: [0x0f,0x43,0xc1]
ret ## encoding: [0xc3]
llvm-svn: 122451
2010-12-22 23:09:28 +00:00
Benjamin Kramer
c8b035d006
Factor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize it
...
to catch cases where n != m with a shift.
llvm-svn: 121608
2010-12-11 09:42:59 +00:00
Evan Cheng
d4b0873c06
Enable sibling call optimization of libcalls which are expanded during
...
legalization time. Since at legalization time there is no mapping from
SDNode back to the corresponding LLVM instruction and the return
SDNode is target specific, this requires a target hook to check for
eligibility. Only x86 and ARM support this form of sibcall optimization
right now.
rdar://8707777
llvm-svn: 120501
2010-11-30 23:55:39 +00:00
Chris Lattner
5d2262dc76
apparently tailcalls are better on darwin/x86-64 than on linux?
...
llvm-svn: 119947
2010-11-21 18:59:20 +00:00
Dan Gohman
3c9b5f394b
Don't narrow the load and store in a load+twiddle+store sequence unless
...
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.
This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.
llvm-svn: 112861
2010-09-02 21:18:42 +00:00
Eli Friedman
f75de6eae7
A couple of small missed optimizations.
...
llvm-svn: 112411
2010-08-29 05:07:40 +00:00
Eric Christopher
9a77382685
Custom lower the memory barrier instructions and add support
...
for lowering without sse2. Add a couple of new testcases.
Fixes a few libgomp tests and latent bugs. Remove a few todos.
llvm-svn: 109078
2010-07-22 02:48:34 +00:00
Eli Friedman
1f41303260
Remove a fixed item, update a couple partially-fixed items.
...
llvm-svn: 105375
2010-06-03 01:01:48 +00:00
Dan Gohman
312d604ee2
This is now done.
...
llvm-svn: 97450
2010-03-01 17:43:57 +00:00
Eli Friedman
4d4c6944e9
A few missed optimizations; the last one could have a significant impact on
...
code with lots of bitfields.
llvm-svn: 95809
2010-02-10 21:26:04 +00:00
Chris Lattner
3eb76c23dd
this is an SSE-specific issue.
...
llvm-svn: 93373
2010-01-13 23:29:11 +00:00
Chris Lattner
fb534d97b5
X86 if conversion + tail merging issues from PR6032.
...
llvm-svn: 93372
2010-01-13 23:28:40 +00:00
Dan Gohman
5d1987f9a0
Remove some README.txt entries which are now implemented.
...
llvm-svn: 92511
2010-01-04 20:55:05 +00:00
Eli Friedman
dbe2aa91b9
A couple minor README updates.
...
llvm-svn: 91823
2009-12-21 08:03:16 +00:00
Bill Wendling
fd2730ee8c
Move and clarify note.
...
llvm-svn: 85334
2009-10-27 22:48:31 +00:00
Bill Wendling
2974f63cb5
Note corrected.
...
llvm-svn: 85332
2009-10-27 22:43:24 +00:00
Bill Wendling
cd4d148040
Modify note.
...
llvm-svn: 85331
2009-10-27 22:40:45 +00:00
Bill Wendling
a205402c16
Add a note.
...
llvm-svn: 85329
2009-10-27 22:34:43 +00:00
Evan Cheng
92df9c3323
Add a note.
...
llvm-svn: 77584
2009-07-30 08:56:19 +00:00
Chris Lattner
b127c0684f
remove a bogus note.
...
llvm-svn: 74509
2009-06-30 05:22:31 +00:00
Chris Lattner
5ed255e642
add a note
...
llvm-svn: 74508
2009-06-30 04:20:46 +00:00
Chris Lattner
0101f45785
another xform that is target-independent (should be done in instcombine).
...
llvm-svn: 73472
2009-06-16 06:15:56 +00:00
Chris Lattner
aba55a69b1
I think instcombine should unconditionally do this xform.
...
llvm-svn: 73471
2009-06-16 06:11:35 +00:00
Eli Friedman
32ad5e9c08
Misc x86 README updates: remove a couple of already-fixed issues,
...
add a few suggestions from looking at some assembly code.
llvm-svn: 73210
2009-06-11 23:07:04 +00:00
Chris Lattner
9b65031add
add some late optimizations that GCC does. It thinks these are a win
...
even on Core2, not just AMD processors which was a surprise to me.
llvm-svn: 72396
2009-05-25 20:28:19 +00:00
Chris Lattner
be31b7b534
we should eventually add -march=atom and the new atom movbe instruction.
...
llvm-svn: 72387
2009-05-25 16:34:44 +00:00
Chris Lattner
4147f08e44
Move 3 "(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))"
...
related transformations out of target-specific dag combine into the
ARM backend. These were added by Evan in r37685 with no testcases
and only seems to help ARM (e.g. test/CodeGen/ARM/select_xform.ll).
Add some simple X86-specific (for now) DAG combines that turn things
like cond ? 8 : 0 -> (zext(cond) << 3). This happens frequently
with the recently added cp constant select optimization, but is a
very general xform. For example, we now compile the second example
in const-select.ll to:
_test:
movsd LCPI2_0, %xmm0
ucomisd 8(%esp), %xmm0
seta %al
movzbl %al, %eax
movl 4(%esp), %ecx
movsbl (%ecx,%eax,4), %eax
ret
instead of:
_test:
movl 4(%esp), %eax
leal 4(%eax), %ecx
movsd LCPI2_0, %xmm0
ucomisd 8(%esp), %xmm0
cmovbe %eax, %ecx
movsbl (%ecx), %eax
ret
This passes multisource and dejagnu.
llvm-svn: 66779
2009-03-12 06:52:53 +00:00
Dan Gohman
b0d4009ec8
Add more information to the EFLAGS note.
...
llvm-svn: 66515
2009-03-10 00:26:23 +00:00
Dan Gohman
d5b35ee215
Add a note about EFLAGS optimization.
...
llvm-svn: 66508
2009-03-09 23:47:02 +00:00
Chris Lattner
393ac62837
add a note.
...
llvm-svn: 66360
2009-03-08 03:04:26 +00:00
Chris Lattner
cfd1f7aa9f
add a note.
...
llvm-svn: 66359
2009-03-08 01:54:43 +00:00
Chris Lattner
cba4b6f83d
add a horrible note
...
llvm-svn: 64719
2009-02-17 01:16:14 +00:00
Dan Gohman
f6ccacba36
MachineLICM now handles these cases.
...
llvm-svn: 64620
2009-02-15 23:24:52 +00:00
Chris Lattner
1aca40e349
add a note.
...
llvm-svn: 64093
2009-02-08 20:44:19 +00:00
Chris Lattner
527dd60430
add a note
...
llvm-svn: 60632
2008-12-06 22:49:05 +00:00
Eli Friedman
e9ef170d4a
A couple small cleanups, plus a new potential optimization.
...
llvm-svn: 60286
2008-11-30 07:52:27 +00:00
Evan Cheng
2d1937ede5
Add a README entry.
...
llvm-svn: 59052
2008-11-11 17:35:52 +00:00
Torok Edwin
33986d8f17
move the note to the correct README
...
llvm-svn: 58104
2008-10-24 19:23:07 +00:00
Dan Gohman
b1d8d6ecff
This is done.
...
llvm-svn: 57733
2008-10-17 21:38:40 +00:00
Evan Cheng
4884f87822
This is done.
...
llvm-svn: 55348
2008-08-26 01:13:44 +00:00
Nate Begeman
3851e29e20
Remove unnecessary readme entry
...
llvm-svn: 53722
2008-07-17 17:21:14 +00:00
Dan Gohman
02a2aaf2e7
Add a note about a potential PIC optimization.
...
llvm-svn: 52663
2008-06-24 00:53:07 +00:00
Chris Lattner
6e2bf7c67e
add a micro optzn.
...
llvm-svn: 50681
2008-05-05 23:19:45 +00:00
Chris Lattner
a89143f1e0
Add an ugly note.
...
llvm-svn: 50029
2008-04-21 04:46:30 +00:00
Evan Cheng
81e0c9a32c
New entry.
...
llvm-svn: 48912
2008-03-28 07:07:06 +00:00
Evan Cheng
58db865d6e
Remove duplicated entries.
...
llvm-svn: 48714
2008-03-23 22:56:07 +00:00
Christopher Lamb
8fe9109469
Fix X86's isTruncateFree to not claim that truncate to i1 is free. This fixes Bill's testcase that failed for r48491.
...
llvm-svn: 48542
2008-03-19 08:30:06 +00:00
Chris Lattner
477d0f5294
Add an issue that is preventing instcombine from doing a simplification.
...
llvm-svn: 48356
2008-03-14 06:00:19 +00:00
Chris Lattner
a76e23a935
move these to the appropriate file
...
llvm-svn: 48054
2008-03-08 22:28:45 +00:00
Gabor Greif
636ab19205
some more spelling changes
...
llvm-svn: 47996
2008-03-06 10:51:21 +00:00