Commit Graph

1515 Commits

Author SHA1 Message Date
Evan Cheng ca7c690d3b Propagate zest through logical shift.
llvm-svn: 91378
2009-12-15 00:41:36 +00:00
Dan Gohman cecad35728 Fix integer cast code to handle vector types.
llvm-svn: 91362
2009-12-14 23:40:38 +00:00
Evan Cheng 26fdd7265b Disable r91104 for x86. It causes partial register stall which pessimize code in 32-bit.
llvm-svn: 91223
2009-12-12 20:03:14 +00:00
Dan Gohman 1d459e4937 Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
llvm-svn: 91158
2009-12-11 21:31:27 +00:00
Dan Gohman bffa061e02 Change this to the correct PR number.
llvm-svn: 91148
2009-12-11 20:09:21 +00:00
Dan Gohman 6d306bb32b Fix the result type of SELECT nodes lowered from Select instructions with
aggregate return values. This fixes PR5754.

llvm-svn: 91145
2009-12-11 19:50:50 +00:00
Anton Korobeynikov fc51282cbe Honour setHasCalls() set from isel.
This is used in some weird cases like general dynamic TLS model.
This fixes PR5723

llvm-svn: 91144
2009-12-11 19:39:55 +00:00
Evan Cheng ff2ac71b25 Tests for 91103 and 91104.
llvm-svn: 91105
2009-12-11 06:02:21 +00:00
Evan Cheng 4986588ddb It's not safe to coalesce a move where src and dst registers have different subregister indices. e.g.:
%reg16404:1<def> = MOV8rr %reg16412:2<kill>

llvm-svn: 91061
2009-12-10 20:59:45 +00:00
Evan Cheng 2262909b20 Fix test.
llvm-svn: 90988
2009-12-09 22:24:42 +00:00
Evan Cheng 493b882f80 Optimize splat of a scalar load into a shuffle of a vector load when it's legal. e.g.
vector_shuffle (scalar_to_vector (i32 load (ptr + 4))), undef, <0, 0, 0, 0>
=>
vector_shuffle (v4i32 load ptr), undef, <1, 1, 1, 1>

iff ptr is 16-byte aligned (or can be made into 16-byte aligned).

llvm-svn: 90984
2009-12-09 21:00:30 +00:00
David Greene 76a7edc36d Use FileCheck and set nounwind on calls.
llvm-svn: 90790
2009-12-07 19:40:26 +00:00
Dan Gohman 9528ccdd77 Don't enable the post-RA scheduler on x86 except at -O3. In its
current form, it is too expensive in compile time.

llvm-svn: 90781
2009-12-07 19:04:31 +00:00
Bill Wendling f89986235d Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
llvm-svn: 90653
2009-12-05 07:30:23 +00:00
Jakob Stoklund Olesen ca9cf65455 Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch takes care of a few more cases that r90163 missed.

llvm-svn: 90502
2009-12-04 00:16:04 +00:00
Nate Begeman 9655f84662 Don't pull vector sext through both hands of a logical operation, since doing so prevents the fusion of vector sext and setcc into vsetcc.
Add a testcase for the above transformation.
Fix a bogus use of APInt noticed while tracking this down.

llvm-svn: 90423
2009-12-03 07:11:29 +00:00
Bill Wendling 76bf386af0 Remove unnecessary check.
llvm-svn: 90352
2009-12-02 22:02:20 +00:00
Evan Cheng 732351f732 Fix PR5391: support early clobber physical register def tied with a use (ewwww)
- A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber.
- If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range.
- Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature".

llvm-svn: 90269
2009-12-01 22:25:00 +00:00
Jakob Stoklund Olesen 26667abbd3 Use CFG connectedness as a secondary sort key when deciding the order of copy coalescing.
This means that well connected blocks are copy coalesced before the less connected blocks. Connected blocks are more difficult to
coalesce because intervals are more complicated, so handling them first gives a greater chance of success.

llvm-svn: 90194
2009-12-01 03:03:00 +00:00
Jakob Stoklund Olesen 020d8d4c63 New virtual registers created for spill intervals should inherit allocation hints from the original register.
This helps us avoid silly copies when rematting values that are copied to a physical register:

leaq	_.str44(%rip), %rcx
movq	%rcx, %rsi
call	_strcmp

becomes:

leaq	_.str44(%rip), %rsi
call	_strcmp

The coalescer will not touch the movq because that would tie down the physical register.

llvm-svn: 90163
2009-11-30 22:55:54 +00:00
Mon P Wang 031cb00246 Add test case for r90108
llvm-svn: 90109
2009-11-30 02:42:27 +00:00
Evan Cheng a4c986cbdd Test for 89905.
llvm-svn: 89906
2009-11-26 00:35:01 +00:00
Benjamin Kramer a9268a4525 Turns out stuff gets allocated to different registers depending on the subtarget.
llvm-svn: 89594
2009-11-22 15:15:52 +00:00
Edward O'Callaghan 7150767800 Fix for bad FileCheck converts in revision 89584.
llvm-svn: 89586
2009-11-22 12:50:05 +00:00
Edward O'Callaghan 15dd46215e Convert a few tests to FileCheck for PR5307.
llvm-svn: 89584
2009-11-22 11:45:44 +00:00
Evan Cheng 73f9a9e2c8 Enable hoisting load from constant memories.
llvm-svn: 89510
2009-11-20 23:31:34 +00:00
Sean Callanan c1f532e930 Recommitting PALIGNR shift width fixes.
Thanks to Daniel Dunbar for fixing clang intrinsics:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=89499

llvm-svn: 89500
2009-11-20 22:28:42 +00:00
Sean Callanan 19d92728d0 Reverting PALIGNR fix until I figure out how this
broke the Clang testsuite.

llvm-svn: 89495
2009-11-20 22:09:28 +00:00
Sean Callanan fbed130173 Fixed PALIGNR to take 8-bit rotations in all cases.
Also fixed the corresponding testcase, and the PALIGNR
  intrinsic (tested for correctness with llvm-gcc).

llvm-svn: 89491
2009-11-20 21:40:28 +00:00
Dan Gohman 20c8ab655e Fix fast-isel to avoid selecting the return instruction if a
tail call has been encountered.

llvm-svn: 89444
2009-11-20 02:51:26 +00:00
Bill Wendling 77f0ea6b93 Test from Dhrystone to make sure that we're not emitting an aligned load for a
string that's aligned at 8-bytes instead of 16-bytes.

llvm-svn: 89295
2009-11-19 01:33:57 +00:00
Jakob Stoklund Olesen 575c3f3d72 Fix PR5300.
When TwoAddressInstructionPass deletes a dead instruction, make sure that all
register kills are accounted for. The 2-addr register does not get special
treatment.

llvm-svn: 89246
2009-11-18 21:33:35 +00:00
Jakob Stoklund Olesen 4797e58d6b Fix inverted test and add testcase from failing self-host.
llvm-svn: 89167
2009-11-18 00:02:18 +00:00
Jakob Stoklund Olesen 50ee5e7ddb Remove fragile test.
llvm-svn: 89150
2009-11-17 21:52:40 +00:00
Jakob Stoklund Olesen fffff88a3c Enable -split-phi-edges by default, except when -regalloc=local.
The local register allocator doesn't like it when LiveVariables is run.
We should also disable edge splitting under -O0, but that has to wait a bit.

llvm-svn: 89125
2009-11-17 19:15:50 +00:00
Evan Cheng 84efacfaad Revert 89021. It's miscompiling llvm-gcc driver driver at -O0.
llvm-svn: 89082
2009-11-17 09:55:52 +00:00
Jakob Stoklund Olesen 9f0d55d8d8 Enable -split-phi-edges by default
llvm-svn: 89021
2009-11-17 01:07:22 +00:00
Evan Cheng d33400e636 MOV64rm should be marked isReMaterializable.
llvm-svn: 89019
2009-11-17 00:55:55 +00:00
Dan Gohman b43e1ff236 Fix this test - there don't appear to be any actual Reload Reuses
in this testcase.

llvm-svn: 88998
2009-11-16 23:49:55 +00:00
Dan Gohman 9dede3b383 Revert r87049, which was the workaround for the regression triggered
by the recent FixedStackPseudoSourceValue-related changes, now that
the specific bug that affected it is fixed, in r88954.

llvm-svn: 88997
2009-11-16 23:43:42 +00:00
Evan Cheng f25ef4ffb0 - Check memoperand alignment instead of checking stack alignment. Most load / store folding instructions are not referencing spill stack slots.
- Mark MOVUPSrm re-materializable.

llvm-svn: 88974
2009-11-16 21:56:03 +00:00
David Greene 25905c8336 Support spill comments.
Have the asm printer emit a comment if an instruction is a spill or
reload and have the spiller mark copies it introdues so the asm printer
can also annotate those.

llvm-svn: 88911
2009-11-16 15:12:23 +00:00
Evan Cheng 16797a1f55 Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
llvm-svn: 88753
2009-11-14 03:42:17 +00:00
Dan Gohman a627e26d39 Enable the tail call optimization when the caller returns undef.
llvm-svn: 88737
2009-11-14 02:06:30 +00:00
Dan Gohman 225fa59cac When optimizing for size, don't tail-merge unless it's likely to be a
code-size win, and not when it's only likely to be code-size neutral,
such as when only a single instruction would be eliminated and a new
branch would be required.

This fixes rdar://7392894.

llvm-svn: 88692
2009-11-13 21:02:15 +00:00
Dan Gohman f80dc08059 Don't let a noalias difference disrupt the tailcall optimization.
llvm-svn: 88672
2009-11-13 18:49:38 +00:00
Daniel Dunbar 3f75f5ddcb Update test.
llvm-svn: 87049
2009-11-13 01:01:58 +00:00
Dan Gohman 09478e975d Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.

llvm-svn: 86909
2009-11-12 00:39:10 +00:00
Kenneth Uildriks 9f34406a90 x86 users can now return arbitrary sized structs. Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.
llvm-svn: 86876
2009-11-11 19:59:24 +00:00
Dan Gohman 64b5d0f468 Add support for tail duplication to BranchFolding, and extend
tail merging support to handle more cases.
 - Recognize several cases where tail merging is beneficial even when
   the tail size is smaller than the generic threshold.
 - Make use of MachineInstrDesc::isBarrier to help detect
   non-fallthrough blocks.
 - Check for and avoid disrupting fall-through edges in more cases.

llvm-svn: 86871
2009-11-11 19:48:59 +00:00