Commit Graph

10077 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 07f4fa8198 TwoAddressInstructionPass::CoalesceExtSubRegs can insert INSERT_SUBREG
instructions, but it doesn't really understand live ranges, so the first
INSERT_SUBREG uses an implicitly defined register.

Fix it in LiveVariableAnalysis by adding the <undef> flag.

llvm-svn: 106333
2010-06-18 22:29:44 +00:00
Evan Cheng cf9e8a987f Fix an inverted condition.
llvm-svn: 106330
2010-06-18 22:17:13 +00:00
Jakob Stoklund Olesen 22a212f97c When using ADDri to get the address of a stack object, 255 is a conservative
limit on the offset that can be materialized without using the register
scavenger.

llvm-svn: 106312
2010-06-18 20:59:25 +00:00
Dan Gohman 24ceda8eb0 Revert r106304 (105548 and friends), which are the SCEVComplexityCompare
optimizations. There is still some nondeterminism remaining.

llvm-svn: 106306
2010-06-18 19:54:20 +00:00
Bruno Cardoso Lopes 23f8321cbc Teach tablegen how to inherit from classes in 'defm' definitions.
The rule is simple: only inherit from a class list if they come
in the end, after the last multiclass.

llvm-svn: 106305
2010-06-18 19:53:41 +00:00
Dan Gohman 4c807fca97 Reapply 105540, 105542, and 105548, and revert r105732.
llvm-svn: 106304
2010-06-18 19:26:04 +00:00
Dale Johannesen c1570dda5c Enable tail calls on ARM by default, with some
basic tests.

This has been well tested on Darwin but not elsewhere.
It should work provided the linker correctly resolves
  B.W  <label in other function>
which it has not seen before, at least from llvm-based
compilers.  I'm leaving the arm-tail-calls switch in
until I see if there's any problems because of that;
it might need to be disabled for some environments.

llvm-svn: 106299
2010-06-18 19:00:18 +00:00
Jakob Stoklund Olesen b9f91667e1 Treat the ARM inline asm {cc} constraint as a physreg (%CPSR), just like X86
does for {flags}. If we create virtual registers of the CCR class, RegAllocFast
may try to spill them, and we can't do that.

llvm-svn: 106289
2010-06-18 16:49:33 +00:00
Dan Gohman 559020df1d Don't write a file named "&1".
llvm-svn: 106269
2010-06-18 01:49:17 +00:00
Dan Gohman f3aea7aecf Disable indvars on loops when LoopSimplify form is not available.
This fixes PR7333.

llvm-svn: 106267
2010-06-18 01:35:11 +00:00
Dan Gohman 99ba4dac59 Don't maintain a set of deleted nodes; instead, use a HandleSDNode
to track a node over CSE events. This fixes PR7368.

llvm-svn: 106266
2010-06-18 01:24:29 +00:00
Bruno Cardoso Lopes 2323168705 Add {mix,max}{ss,sd}{rr,rm} AVX forms.
llvm-svn: 106264
2010-06-18 01:12:56 +00:00
Dan Gohman b92156d5e4 Fold the ShrinkDemandedOps pass into the regular DAGCombiner pass,
which is faster, simpler, and less surprising.

llvm-svn: 106263
2010-06-18 01:05:21 +00:00
Dan Gohman 30d7a51d6c Make this test less fragile.
llvm-svn: 106255
2010-06-18 00:06:03 +00:00
Dale Johannesen 1f8e5fbc7a Testcase for llvm-gcc 106225.
llvm-svn: 106226
2010-06-17 17:43:14 +00:00
Rafael Espindola 29dda21e96 Remove arm_apcscc from the test files. It is the default and doing this
matches what llvm-gcc and clang now produce.

llvm-svn: 106221
2010-06-17 15:18:27 +00:00
Bruno Cardoso Lopes 4d1d798736 For a tablegen expression such as !if(a,b,c), let 'a'
be evaluated for 'bit' operators

llvm-svn: 106185
2010-06-17 00:31:36 +00:00
Bruno Cardoso Lopes 77a4a56251 let the '!eq' expression support 'int' and 'bit' types
llvm-svn: 106171
2010-06-16 23:24:12 +00:00
Jakob Stoklund Olesen 207cd4bbd7 Allow a register to be redefined multiple times in a basic block.
LiveVariableAnalysis was a bit picky about a register only being redefined once,
but that really isn't necessary.

Here is an example of chained INSERT_SUBREGs that we can handle now:

68      %reg1040<def> = INSERT_SUBREG %reg1040, %reg1028<kill>, 14
                register: %reg1040 +[70,134:0)
76      %reg1040<def> = INSERT_SUBREG %reg1040, %reg1029<kill>, 13
                register: %reg1040 replace range with [70,78:1) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,134:0)  0@78-(134) 1@70-(78)
84      %reg1040<def> = INSERT_SUBREG %reg1040, %reg1030<kill>, 12
                register: %reg1040 replace range with [78,86:2) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,86:2)[86,134:0)  0@86-(134) 1@70-(78) 2@78-(86)
92      %reg1040<def> = INSERT_SUBREG %reg1040, %reg1031<kill>, 11
                register: %reg1040 replace range with [86,94:3) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,86:2)[86,94:3)[94,134:0)  0@94-(134) 1@70-(78) 2@78-(86) 3@86-(94)

rdar://problem/8096390

llvm-svn: 106152
2010-06-16 21:29:40 +00:00
Jim Grosbach 2c8b829238 modify so the test doesn't drop an output file in the test source directory.
The test should also likely have some FileCheck bits to validate the
output(?).

llvm-svn: 106146
2010-06-16 21:07:06 +00:00
Devang Patel 79b0da30fb Be specific. Use FileCheck.
llvm-svn: 106135
2010-06-16 19:39:45 +00:00
Rafael Espindola a20e2dfe86 Make sure that simplify libcalls does not replace a call with one calling
convention with a new call with a different calling convention.

llvm-svn: 106134
2010-06-16 19:34:01 +00:00
Devang Patel e3721dd27c This requires more investigation. Unblock buildbots for now.
llvm-svn: 106122
2010-06-16 18:19:49 +00:00
Devang Patel 37e4f98cb6 Update test to explicitly capture llc output.
llvm-svn: 106121
2010-06-16 18:04:12 +00:00
Benjamin Kramer a13bd20396 simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)
The memcmp will be optimized further and even the pathological case
'strstr(x, "x") == x' generates optimal code now.

llvm-svn: 106097
2010-06-16 10:30:29 +00:00
Evan Cheng f128bdcb55 Make post-ra scheduling, anti-dep breaking, and register scavenger (conservatively) aware of predicated instructions. This enables ARM to move if-conversion before post-ra scheduler.
llvm-svn: 106091
2010-06-16 07:35:02 +00:00
Bill Wendling 8c0cf0994d Create a more targeted fix for not sinking instructions into a range where it
will conflict with another live range. The place which creates this scenerio is
the code in X86 that lowers a select instruction by splitting the MBBs. This
eliminates the need to check from the bottom up in an MBB for live pregs.

llvm-svn: 106066
2010-06-15 23:46:31 +00:00
Rafael Espindola 1115afb092 Update test to match recent llvm-gcc change.
llvm-svn: 106056
2010-06-15 22:16:40 +00:00
Jakob Stoklund Olesen ec2e964fd6 Remove the local register allocator.
Please use the fast allocator instead.

llvm-svn: 106051
2010-06-15 21:58:33 +00:00
Benjamin Kramer 1118860e3a simplify-libcalls: fold strstr(a, b) == a -> strncmp(a, b, strlen(b)) == 0
llvm-svn: 106047
2010-06-15 21:34:25 +00:00
Rafael Espindola ae591be4e9 Set the mtriple in some tests so that they use AAPCS.
llvm-svn: 106041
2010-06-15 20:42:00 +00:00
Mon P Wang 7a84689cc5 Fixed vector widening of binary instructions that can trap. Patch by Visa Putkinen!
llvm-svn: 106038
2010-06-15 20:29:05 +00:00
Chris Lattner 874c92bd47 fix fastisel to handle GS and FS relative pointers. Patch by
Nelson Elhage!

llvm-svn: 106031
2010-06-15 19:08:40 +00:00
Rafael Espindola 5a24a56e1e Remove the arm_aapcscc marker from the tests. It is the default
for the linux targets.

llvm-svn: 106029
2010-06-15 19:04:29 +00:00
Jakob Stoklund Olesen 246e9a07a2 Avoid processing early clobbers twice in RegAllocFast.
Early clobbers defining a virtual register were first alocated to a physreg and
then processed as a physreg EC, spilling the virtreg.

This fixes PR7382.

llvm-svn: 105998
2010-06-15 16:20:57 +00:00
Jakob Stoklund Olesen 82eca35b3e Add CoalescerPair helper class.
Given a copy instruction, CoalescerPair can determine which registers to
coalesce in order to eliminate the copy. It deals with all the subreg fun to
determine a tuple (DstReg, SrcReg, SubIdx) such that:

- SrcReg is a virtual register that will disappear after coalescing.
- DstReg is a virtual or physical register whose live range will be extended.
- SubIdx is 0 when DstReg is a physical register.
- SrcReg can be joined with DstReg:SubIdx.

CoalescerPair::isCoalescable() determines if another copy instruction is
compatible with the same tuple. This fixes some NEON miscompilations where
shuffles are getting coalesced as if they were copies.

The CoalescerPair class will replace a lot of the spaghetti logic in JoinCopy
later.

llvm-svn: 105997
2010-06-15 16:04:21 +00:00
Bob Wilson a55b8877e6 Generalize the pre-coalescing of extract_subregs feeding reg_sequences,
replacing the overly conservative checks that I had introduced recently to
deal with correctness issues.  This makes a pretty noticable difference
in our testcases where reg_sequences are used.  I've updated one test to
check that we no longer emit the unnecessary subreg moves.

llvm-svn: 105991
2010-06-15 05:56:31 +00:00
Chris Lattner 00ab615406 apparently lots of dupes.
llvm-svn: 105956
2010-06-14 20:19:03 +00:00
Chris Lattner faa7bdccbf fix a nasty bug where we were not treating available_externally
symbols as declarations in the X86 backend.  This would manifest
on darwin x86-32 as errors like this with -fvisibility=hidden:

symbol '__ZNSbIcED1Ev' can not be undefined in a subtraction expression

This fixes PR7353.

llvm-svn: 105954
2010-06-14 20:11:56 +00:00
Chris Lattner bbb798c7d1 remove old test.
llvm-svn: 105953
2010-06-14 20:07:43 +00:00
Chris Lattner b30f87b74e rename test
llvm-svn: 105952
2010-06-14 20:07:34 +00:00
Chris Lattner 329ea064ed jump threading can't split a critical edge from an indirectbr. This
fixes PR7356.

llvm-svn: 105950
2010-06-14 19:45:43 +00:00
Stuart Hastings 37b827fd11 Test case for Radar 8004649.
llvm-svn: 105949
2010-06-14 18:37:04 +00:00
Benjamin Kramer 6e42d53cb3 Test case for r105914.
llvm-svn: 105915
2010-06-13 16:16:54 +00:00
Daniel Dunbar 250a21b79b tests: Run macho-dump with binary unbuffered streams on Windows, I can't find a Python 2.6 way to change stdin to binary.
llvm-svn: 105894
2010-06-12 17:05:28 +00:00
Daniel Dunbar edcc628289 tests: Make macho-dump.bat actually work.
llvm-svn: 105891
2010-06-12 16:21:54 +00:00
Daniel Dunbar 12225eb687 tests: Propogate LLVM_SRC_ROOT and PYTHON_EXECUTABLE environment variables to tests.
llvm-svn: 105890
2010-06-12 16:21:19 +00:00
Bruno Cardoso Lopes a714ea0f7d More AVX: {ADD,SUB,MUL,DIV}{PD,PS}rm
llvm-svn: 105870
2010-06-12 01:53:48 +00:00
Bruno Cardoso Lopes b06f54b852 More AVX: {ADD,SUB,MUL,DIV}{PD,PS}rr
Handle OpSize TSFlag for AVX

llvm-svn: 105869
2010-06-12 01:23:26 +00:00
Bruno Cardoso Lopes fd5458d4bd More AVX instructions ({ADD,SUB,MUL,DIV}{SS,SD}rm)
Introduce the VEX_X field

llvm-svn: 105859
2010-06-11 23:50:47 +00:00