Commit Graph

2102 Commits

Author SHA1 Message Date
Scott Michel
1a6cdb6b50 CellSPU:
- Fix v2[if]64 vector insertion code before IBM files a bug report.
- Ensure that zero (0) offsets relative to $sp don't trip an assert
  (add $sp, 0 gets legalized to $sp alone, tripping an assert)
- Shuffle masks passed to SPUISD::SHUFB are now v16i8 or v4i32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 17:56:02 +00:00
Eli Friedman
fc69cb475f Followup to r60283: optimize arbitrary width signed divisions as well
as unsigned divisions.  Same caveats as before.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 06:35:39 +00:00
Eli Friedman
201c9776bd Fix for PR2164: allow transforming arbitrary-width unsigned divides into
multiplies.

Some more cleverness would be nice, though. It would be nice if we 
could do this transformation on illegal types.  Also, we would 
prefer a narrower constant when possible so that we can use a narrower
multiply, which can be cheaper.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60283 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 06:02:26 +00:00
Eli Friedman
86f874d9bb APIntify a test which is potentially unsafe otherwise, and fix the
nearby FIXME.

I'm not sure what the right way to fix the Cell test was; if the 
approach I used isn't okay, please let me know.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 04:59:26 +00:00
Bill Wendling
753e3ba5a6 XFAil test due to reverting of patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:34:10 +00:00
Evan Cheng
df90841690 Avoid inserting noop's in the middle of a loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:16:00 +00:00
Evan Cheng
884c70c912 On x86 favors folding short immediate into some arithmetic operations (e.g. add, and, xor, etc.) because materializing an immediate in a register is expensive in turns of code size.
e.g.
movl 4(%esp), %eax
addl $4, %eax

is 2 bytes shorter than

movl $4, %eax
addl 4(%esp), %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:49:46 +00:00
Evan Cheng
bc7e0f5dd6 Add -march=x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:37:06 +00:00
Bill Wendling
e21815f41b Add x86-specific test for add-with-overflow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:42:19 +00:00
Chris Lattner
ab8b794a78 Turn on my codegen prepare heuristic by default. It doesn't affect
performance in most cases on the Grawp tester, but does speed some 
things up (like shootout/hash by 15%).  This also doesn't impact 
compile time in a noticable way on the Grawp tester.

It also, of course, gets the testcase it was designed for right :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:16:44 +00:00
Duncan Sands
af7852f094 Check that running the DAG combiner between type
and operation legalization does something useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 16:44:30 +00:00
Chris Lattner
5eecb7f164 This adds in some code (currently disabled unless you pass
-enable-smarter-addr-folding to llc) that gives CGP a better
cost model for when to sink computations into addressing modes.
The basic observation is that sinking increases register 
pressure when part of the addr computation has to be available
for other reasons, such as having a use that is a non-memory
operation.  In cases where it works, it can substantially reduce
register pressure.

This code is currently an overall win on 403.gcc and 255.vortex
(the two things I've been looking at), but there are several 
things I want to do before enabling it by default:

1. This isn't doing any caching of results, so it is much slower 
   than it could be.  It currently slows down release-asserts llc 
   by 1.7% on 176.gcc: 27.12s -> 27.60s.
2. This doesn't think about inline asm memory operands yet.
3. The cost model botches the case when the needed value is live
   across the computation for other reasons.

I'll continue poking at this, and eventually turn it on as llcbeta.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 02:00:14 +00:00
Chris Lattner
2efbbb38ba Teach CodeGenPrepare to look through Bitcast instructions when attempting to
optimize addressing modes.  This allows us to optimize things like isel-sink2.ll
into:

	movl	4(%esp), %eax
	cmpb	$0, 4(%eax)
	jne	LBB1_2	## F
LBB1_1:	## TB
	movl	$4, %eax
	ret
LBB1_2:	## F
	movzbl	7(%eax), %eax
	ret

instead of:

_test:
	movl	4(%esp), %eax
	cmpb	$0, 4(%eax)
	leal	4(%eax), %eax
	jne	LBB1_2	## F
LBB1_1:	## TB
	movl	$4, %eax
	ret
LBB1_2:	## F
	movzbl	3(%eax), %eax
	ret

This shrinks (e.g.) 403.gcc from 1133510 to 1128345 lines of .s.

Note that the 2008-10-16-SpillerBug.ll testcase is dubious at best, I doubt
it is really testing what it thinks it is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:26:16 +00:00
Chris Lattner
6d235bb7a0 fix an over-reduced test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:12:08 +00:00
Chris Lattner
d87f570270 this doesn't need EH
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:03:26 +00:00
Scott Michel
18fae69723 CellSPU:
(a) Remove conditionally removed code in SelectXAddr. Basically, hope for the
    best that the A-form and D-form address predicates catch everything before
    the code decides to emit a X-form address.
(b) Expand vector store test cases to include the usual suspects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:29:43 +00:00
Scott Michel
97d0a603e6 CellSPU: test should use shlqby, not shlqbyi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 01:30:37 +00:00
Bill Wendling
39ccca3260 XFAIL this test. A recent CellSPU check-in broke it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60000 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:56:34 +00:00
Dan Gohman
21d9003087 Initial support for anti-dependence breaking. Currently this code does not
introduce any new spilling; it just uses unused registers.

Refactor the SUnit topological sort code out of the RRList scheduler and
make use of it to help with the post-pass scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:52:40 +00:00
Scott Michel
045a14503f CellSPU:
(a) Slight rethink on i64 zero/sign/any extend code - use a shuffle to
    directly zero-extend i32 to i64, but use rotates and shifts for
    sign extension. Also ensure unified register consistency.
(b) Add new test harness for i64 operations: i64ops.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 18:20:46 +00:00
Scott Michel
104de4390b CellSPU:
(a) Improve the extract element code: there's no need to do gymnastics with
    rotates into the preferred slot if a shuffle will do the same thing.
(b) Rename a couple of SPUISD pseudo-instructions for readability and better
    semantic correspondence.
(c) Fix i64 sign/any/zero extension lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:11:17 +00:00
Bill Wendling
d21c6ef9d0 Test add-with-overflow with fast ISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:23:38 +00:00
Bill Wendling
def27392c1 Add support for llvm.uadd.with.overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 01:38:29 +00:00
Scott Michel
7a1c9e9cb7 CellSPU: Fix bug 3056. Varadic extract_element was not implemented (nor was it
ever conceived to occur).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 23:50:42 +00:00
Scott Michel
9c0c6b2e4a CellSPU:
(a) Fix bgs 3052, 3057
(b) Incorporate Duncan's suggestions re: i1 promotion
(c) Indentation updates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59790 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:56:16 +00:00
Bill Wendling
52a5899fd9 Add generic test for add with overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 02:15:51 +00:00
Dan Gohman
eac9cae45e Test -pre-RA-sched=fast too, for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59741 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:26:04 +00:00
Evan Cheng
d37c13cfd1 - Register scavenger should use MachineRegisterInfo and internal map to find the first use of a register after a given machine instruction.
- When scavenging a register, in addition to the spill, insert a restore before the first use.
- Abort if client is looking to scavenge a register even when a previously scavenged register is still live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 02:32:35 +00:00
Dan Gohman
8b677d0b88 Revert r59640. It broke this test for builds that aren't
configured with llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59641 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 16:24:37 +00:00
Dan Gohman
c738ac1d5d Use %llvmgcc -xassembler instead of invoking as directly. This avoids
problems for example when LLVM is built with --with-extra-options=-m64
and as defaults to x86-32 mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 16:02:14 +00:00
Owen Anderson
75fa96bb71 Add support for rematerialization in pre-alloc-splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 04:28:29 +00:00
Evan Cheng
9c64bf3905 Register scavenger should process early clobber defs first. A dead early clobber def should not interfere with a normal def which happens one slot later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:28:38 +00:00
Duncan Sands
51d83fdd89 Reapply r59464, this time using the correct type
when softening FNEG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 09:15:03 +00:00
Bill Wendling
c4ae87ac76 A simple test for stack protectors. This should be valid on all platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 07:34:50 +00:00
Bill Wendling
8f55b3d67d Revert r59464. It was causing this failure:
Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/fneg.ll
Failed with signal(SIGABRT) at line 1
while running:  llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/XCore/fneg.ll |  llc -march=xcore > fneg.ll.tmp1.s
Assertion failed: (VT.isFloatingPoint() && "Cannot create integer FP constant!"), function getConstantFP, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 913.
0   llc                                 0x0092115c _ZN4llvm3sys18RemoveFileOnSignalERKNS0_4PathEPSs + 844
1   libSystem.B.dylib                   0x9217809b _sigtramp + 43
2   ???                                 0xffffffff 0x0 + 4294967295
3   libSystem.B.dylib                   0x921f0ec2 raise + 26
4   libSystem.B.dylib                   0x9220047f abort + 73
5   libSystem.B.dylib                   0x921f2063 __assert_rtn + 101
6   llc                                 0x005a5b0a _ZN4llvm12SelectionDAG13getConmake[1]: *** [check-local] Error 1
make: *** [check] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 01:49:24 +00:00
Duncan Sands
7fed65a68d Add soft float support for a bunch more operations. Original
patch by Richard Osborne, tweaked and extended by your humble
servant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 20:52:38 +00:00
Dale Johannesen
3d631c2d5d Remove these, which test for optimizations that
are not currently done (cf PowerPC/README.txt).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 18:57:45 +00:00
Richard Osborne
104de6cf7b Don't produce ADDC/ADDE when expanding SHL unless they are legal
for the target. This fixes PR3080.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 17:34:31 +00:00
Lang Hames
1aed723261 Removed 2008-10-17-SpillerBug.ll as it does not provide an accurate test of PR2898.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 23:30:12 +00:00
Lang Hames
684bd46a57 2008-10-17-SpillerBug.ll is currently failing, but this doesn't reflect an actual regression of PR2898. This test should probably be removed. I've XFAILed it for now to keep buildbot quiet while this is considered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 13:11:09 +00:00
Mon P Wang
c7849c22f4 Improved shuffle normalization to avoid using extract/build when we
can extract using different indexes for two vectors. Added a few tests
for vector shuffles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-16 05:06:27 +00:00
Richard Osborne
223fd6efc8 [XCore] Fix expansion of 64 bit add/sub. Don't custom expand
these operations if ladd/lsub are not available on the current
subtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 15:59:19 +00:00
Richard Osborne
1d8f975890 Add XCore intrinsics for getid (returns thread id) and bitrev (reverses
bits in a word).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 10:12:16 +00:00
Dan Gohman
d23e0f81bc Remove the FlaggedNodes member from SUnit. Instead of requiring each SUnit
to carry a SmallVector of flagged nodes, just calculate the flagged nodes
dynamically when they are needed.

The local-liveness change is due to a trivial scheduling change where
the scheduler arbitrary decision differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 23:24:17 +00:00
Dale Johannesen
e4f309e582 testcase for PR 1779.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13 22:17:10 +00:00
Duncan Sands
245146b58a Correct some thinkos in the expansion of ADD/SUB
when the target does not support ADDC/SUBC.  This
fixes PR3044.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 08:23:26 +00:00
Dale Johannesen
cbf7cf50ec Fix the testb optimization so x86 also bootstraps.
Reenable test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 02:00:35 +00:00
Andrew Lenharth
683a922653 fix another libgcc blocker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 06:06:07 +00:00
Bill Wendling
935e8e9afe Un-XFAIL tests now that they're fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 04:44:42 +00:00
Bill Wendling
080098e311 r59009 broke these tests. XFAIL for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59010 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 00:36:10 +00:00