Stuart Hastings
03a1927217
Merge pmovzx test case into existing file.
...
llvm-svn: 131539
2011-05-18 17:02:04 +00:00
Eli Friedman
97233814a0
Make some of the fast-isel tests actually test fast-isel (and fix test failures).
...
llvm-svn: 131510
2011-05-18 00:00:10 +00:00
Stuart Hastings
719cee1aa8
X86 pmovsx/pmovzx ignore the upper half of their inputs.
...
rdar://problem/6945110
llvm-svn: 131493
2011-05-17 22:13:31 +00:00
Galina Kistanova
96a3ce9a6f
Move test for appropriate directory.
...
llvm-svn: 131477
2011-05-17 19:06:43 +00:00
Eli Friedman
ba315a4fcc
Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.
...
This is r131438 with a couple small fixes.
llvm-svn: 131474
2011-05-17 18:29:03 +00:00
Eli Friedman
3aa2fe389f
Back out r131444 and r131438; they're breaking nightly tests. I'll look into
...
it more tomorrow.
llvm-svn: 131451
2011-05-17 02:36:59 +00:00
Eli Friedman
410094a937
Fix test.
...
llvm-svn: 131444
2011-05-17 00:39:14 +00:00
Evan Cheng
24322e6f0a
Add target triple so test doesn't fail on Windows machines.
...
llvm-svn: 131439
2011-05-17 00:15:58 +00:00
Eli Friedman
8c4de16d2b
Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.
...
llvm-svn: 131438
2011-05-17 00:13:47 +00:00
Jakob Stoklund Olesen
16f11212fc
Teach LiveInterval::isZeroLength about null SlotIndexes.
...
When instructions are deleted, they leave tombstone SlotIndex entries.
The isZeroLength method should ignore these null indexes.
This causes RABasic to sometimes spill a callee-saved register in the
abi-isel.ll test, so don't run that test with -regalloc=basic. Prioritizing
register allocation according to spill weight can cause more registers to be
used.
llvm-svn: 131436
2011-05-16 23:50:05 +00:00
Eli Friedman
23e7691f59
Remove dead code. Fix associated test to use FileCheck.
...
llvm-svn: 131424
2011-05-16 21:28:22 +00:00
Eli Friedman
cb60e2293f
Make fast-isel work correctly s/uadd.with.overflow intrinsics.
...
llvm-svn: 131420
2011-05-16 21:06:17 +00:00
Eli Friedman
5f1b7e4153
Basic fast-isel of extractvalue. Not too helpful on its own, given the IR clang generates for cases like this, but it should become more useful soon.
...
llvm-svn: 131417
2011-05-16 20:27:46 +00:00
Rafael Espindola
98372d430c
Don't produce a vmovntdq if we don't have AVX support.
...
llvm-svn: 131330
2011-05-14 00:30:01 +00:00
Evan Cheng
f3eb9e3262
Re-enable branchfolding common code hoisting optimization. Fixed a liveness test bug and also taught it to update liveins.
...
llvm-svn: 131241
2011-05-12 20:30:01 +00:00
Devang Patel
344808fbe5
Identify end of prologue (and beginning of function body) using DW_LNS_set_prologue_end line table opcode.
...
llvm-svn: 131194
2011-05-11 19:22:19 +00:00
Nadav Rotem
57dd315a3b
Fixes a bug in the DAGCombiner. LoadSDNodes have two values (data, chain).
...
If there is a store after the load node, then there is a chain, which means
that there is another user. Thus, asking hasOneUser would fail. Instead we
ask hasNUsesOfValue on the 'data' value.
llvm-svn: 131183
2011-05-11 14:40:50 +00:00
Nadav Rotem
2a654a69ed
Add custom lowering of X86 vector SRA/SRL/SHL when the shift amount is a splat vector.
...
llvm-svn: 131179
2011-05-11 08:12:09 +00:00
Rafael Espindola
dfc30289f1
Revert 131172 as it is causing clang to miscompile itself. I will try
...
to provide a reduced testcase.
llvm-svn: 131176
2011-05-11 03:27:17 +00:00
Evan Cheng
271e0ebf0a
Add a late optimization to BranchFolding that hoist common instruction sequences
...
at the start of basic blocks to their common predecessor. It's actually quite
common (e.g. about 50 times in JM/lencod) and has shown to be a nice code size
benefit. e.g.
pushq %rax
testl %edi, %edi
jne LBB0_2
## BB#1:
xorb %al, %al
popq %rdx
ret
LBB0_2:
xorb %al, %al
callq _foo
popq %rdx
ret
=>
pushq %rax
xorb %al, %al
testl %edi, %edi
je LBB0_2
## BB#1:
callq _foo
LBB0_2:
popq %rdx
ret
rdar://9145558
llvm-svn: 131172
2011-05-11 01:03:01 +00:00
Benjamin Kramer
ba7c9948e8
X86: Add a bunch of peeps for add and sub of SETB.
...
"b + ((a < b) ? 1 : 0)" compiles into
cmpl %esi, %edi
adcl $0, %esi
instead of
cmpl %esi, %edi
sbbl %eax, %eax
andl $1, %eax
addl %esi, %eax
This saves a register, a false dependency on %eax
(Intel's CPUs still don't ignore it) and it's shorter.
llvm-svn: 131070
2011-05-08 18:36:07 +00:00
Jakob Stoklund Olesen
bb09bbccb8
Emit a proper error message when register allocators run out of registers.
...
This can't be just an assertion, users can always write impossible inline
assembly. Such an assembly statement should be included in the error message.
llvm-svn: 131024
2011-05-06 21:58:30 +00:00
Eli Friedman
f7b4d848ae
Re-revert r130877; it's apparently causing a regression on 197.parser,
...
possibly related to cbnz formation.
llvm-svn: 130977
2011-05-06 05:23:07 +00:00
Rafael Espindola
ab39b8319b
Don't produce a __debug_frame.
...
I tested both gdb on a bootstrapped clang and and the gdb testsuite on OS X (snow leopard)
and both are happy using __eh_frame.
llvm-svn: 130937
2011-05-05 18:43:39 +00:00
Eli Friedman
09ec41fcde
Avoid extra vreg copies for arguments passed in registers. Specifically, this can make MachineCSE more effective in some cases (especially in small functions). PR8361 / part of rdar://problem/8259436 .
...
llvm-svn: 130928
2011-05-05 16:53:34 +00:00
Jakob Stoklund Olesen
f27731bf40
Prepare remaining tests for -join-physreg going away.
...
llvm-svn: 130893
2011-05-04 23:54:59 +00:00
Jakob Stoklund Olesen
e964058440
Fix a batch of x86 tests to be coalescer independent.
...
Most of these tests require a single mov instruction that can come either before
or after a 2-addr instruction. -join-physregs changes the behavior, but the
results are equivalent.
llvm-svn: 130891
2011-05-04 23:54:51 +00:00
Eli Friedman
5b78092546
Re-commit r130862 with a minor change to avoid an iterator running off the edge in some cases.
...
Original message:
Teach MachineCSE how to do simple cross-block CSE involving physregs. This allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 .
llvm-svn: 130877
2011-05-04 22:10:36 +00:00
Eli Friedman
cc74616be6
Back out r130862; it appears to be breaking bootstrap.
...
llvm-svn: 130867
2011-05-04 20:48:42 +00:00
Eli Friedman
e086e00208
Teach MachineCSE how to do simple cross-block CSE involving physregs. This allows, for example, eliminating duplicate cmpl's on x86. Part of rdar://problem/8259436 .
...
llvm-svn: 130862
2011-05-04 19:54:24 +00:00
Jakob Stoklund Olesen
4d020cd8e5
Don't depend on the physreg coalescing order.
...
llvm-svn: 130818
2011-05-04 01:01:47 +00:00
Bill Wendling
67f5e8f0a7
Replace the "movnt" intrinsics with a native store + nontemporal metadata bit.
...
<rdar://problem/8460511>
llvm-svn: 130791
2011-05-03 21:11:17 +00:00
Rafael Espindola
d49e7769a7
Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
...
llvm-svn: 130658
2011-05-01 15:44:13 +00:00
Rafael Espindola
eb5d0cb4f4
GCC uses a different encoding of pointers in the FDE when using
...
-fno-dwarf2-cfi-asm. Implement the same behavior.
llvm-svn: 130637
2011-05-01 04:49:54 +00:00
Rafael Espindola
886aa563be
Revert the previous patch while I figure out how to make llvm-gcc
...
less agressive about disabling cfi on linux :-(
llvm-svn: 130626
2011-04-30 23:03:44 +00:00
Rafael Espindola
9455887b10
Enable CFI on OS X.
...
Currently the output should be almost identical to the one produced by CodeGen
to make the transition easier.
The only two differences I know of are:
* Some files get an extra advance loc of size 0. This will be fixed when
relaxations are enabled.
* The optimization of declaring an EH symbol as an external variable is not
implemented. This is a subset of adding the nounwind attribute, so we if really
this at -O0 we should probably do it at the IL level.
llvm-svn: 130623
2011-04-30 22:29:54 +00:00
Jakob Stoklund Olesen
c140b5ac84
Allow folded spills in test.
...
llvm-svn: 130599
2011-04-30 08:00:50 +00:00
Jakob Stoklund Olesen
2db84c62f6
Weekly fix of register allocation dependent unit tests.
...
llvm-svn: 130567
2011-04-30 01:37:52 +00:00
Rafael Espindola
16455286cb
Change DwarfCFIException's member variables to track what it actually
...
emmits: .cfi_personality, .cfi_lsda and the moves.
llvm-svn: 130503
2011-04-29 14:48:51 +00:00
Eli Friedman
afc21e9be2
fast-isel sret calls, try 2. We actually do need to do something on x86-32. rdar://problem/9303592 .
...
llvm-svn: 130429
2011-04-28 20:19:12 +00:00
Eli Friedman
73c94e2b24
Actually revert r130348 correctly.
...
llvm-svn: 130418
2011-04-28 18:20:24 +00:00
Eli Friedman
7b68473355
Revert r130348; causing buildbot issues on x86-32.
...
llvm-svn: 130412
2011-04-28 18:06:10 +00:00
Devang Patel
900ceb725b
Teach dwarf writer to handle complex address expression for .debug_loc entries.
...
This fixes clang generated blocks' variables' debug info.
Radar 9279956.
llvm-svn: 130373
2011-04-28 02:22:40 +00:00
Eli Friedman
86181251f3
Fix a silly mistake in r130338.
...
llvm-svn: 130360
2011-04-28 00:42:03 +00:00
Eli Friedman
bcb7cd335d
fast-isel sret. We actually don't need to do anything special on x86. :) rdar://problem/9303592 .
...
llvm-svn: 130348
2011-04-27 23:58:52 +00:00
Eli Friedman
c5406cdb50
Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
...
llvm-svn: 130338
2011-04-27 22:41:55 +00:00
Eli Friedman
00b153c2eb
Fix an edge case involving branches in fast-isel on x86.
...
rdar://problem/9303306 .
llvm-svn: 130272
2011-04-27 01:34:27 +00:00
Evan Cheng
dea3347167
Be careful about scheduling nodes above previous calls. It increase usages of
...
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.
Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.
rdar://9329627
llvm-svn: 130245
2011-04-26 21:31:35 +00:00
Benjamin Kramer
249006aad2
Force a triple on this test to unbreak windows buildbots.
...
llvm-svn: 130226
2011-04-26 18:47:43 +00:00
Dan Gohman
fbb7ade7ae
Fast-isel support for simple inline asms.
...
llvm-svn: 130205
2011-04-26 17:18:34 +00:00