Commit Graph

6286 Commits

Author SHA1 Message Date
Dan Gohman
464fc5a044 Fix printing of PseudoSourceValues in SDNode graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 17:28:10 +00:00
Mon P Wang
d17c030276 Added support to LegalizeType for expanding the operands of scalar to vector
and insert vector element.  Modified extract vector element to extend the
result to match the expected promoted type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 06:57:02 +00:00
Duncan Sands
b6862bbe34 Reapply r60997, this time without forgetting that
target constants are allowed to have an illegal
type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61006 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-14 09:43:15 +00:00
Bill Wendling
2d8cc31521 Temporarily revert r60997. It was causing this failure:
Running /Users/void/llvm/llvm.src/test/CodeGen/Generic/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll
Failed with exit(1) at line 1
while running:  llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll |  llc | /usr/bin/grep 68719476738
Assertion failed: ((TypesNeedLegalizing || getTypeAction(VT) == Legal) && "Illegal type introduced after type legalization?"), function HandleOp, file /Users/void/llvm/llvm.src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 493.
0   llc               0x0085392e char const* std::find<char const*, char>(char const*, char const*, char const&) + 98
1   llc               0x00853e63 llvm::sys::PrintStackTraceOnErrorSignal() + 593
2   libSystem.B.dylib 0x96cac09b _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1765097359
4   libSystem.B.dylib 0x96d24ec2 raise + 26
5   libSystem.B.dylib 0x96d3447f abort + 73
6   libSystem.B.dylib 0x96d26063 __assert_rtn + 101
7   llc               0x004f9018 llvm::cast_retty<llvm::SubprogramDesc, llvm::DebugInfoDesc*>::ret_type llvm::cast<llvm::Sub
...




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 23:53:00 +00:00
Duncan Sands
0f546d4565 LegalizeDAG is not supposed to introduce illegal
types into the DAG if they were not already there.
Check this with an assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 22:33:38 +00:00
Mon P Wang
c5d64607c9 Remove assertion to allow promotion of a truncating store operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 08:16:43 +00:00
Mon P Wang
e1a0b2e0bb Added basic support for expanding VSETCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 08:15:14 +00:00
Duncan Sands
fd6673cf7f On big-endian machines it is wrong to do a full
width register load followed by a truncating
store for the copy, since the load will not place
the value in the lower bits.  Probably partial
loads/stores can never happen here, but fix it
anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 07:18:38 +00:00
Devang Patel
8358099bcb Do not print empty DW_AT_comp_dir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 21:57:54 +00:00
Duncan Sands
05e11fab87 When expanding unaligned loads and stores do not make
use of illegal integer types: instead, use a stack slot
and copying via integer registers.  The existing code
is still used if the bitconvert is to a legal integer
type.

This fires on the PPC testcases 2007-09-08-unaligned.ll
and vec_misaligned.ll.  It looks like equivalent code
is generated with these changes, just permuted, but
it's hard to tell.

With these changes, nothing in LegalizeDAG produces
illegal integer types anymore.  This is a prerequisite
for removing the LegalizeDAG type legalization code.

While there I noticed that the existing code doesn't
handle trunc store of f64 to f32: it turns this into
an i64 store, which represents a 4 byte stack smash.
I added a FIXME about this.  Hopefully someone more
motivated than I am will take care of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 21:47:02 +00:00
Evan Cheng
637ed03173 Fix add/sub expansion: don't create ADD / SUB with two results (seems like everyone is doing this these days :-). Patch by Daniel M Gessel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60958 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 18:49:09 +00:00
Duncan Sands
712f7b3f54 When using a 4 byte jump table on a 64 bit machine,
do an extending load of the 4 bytes rather than a
potentially illegal (type) i32 load followed by a
sign extend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 08:13:38 +00:00
Mon P Wang
9e5ecb8f8f Added support for SELECT v8i8 v4i16 for X86 (MMX)
Added support for TRUNC v8i16 to v8i8 for X86 (MMX)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 01:25:51 +00:00
Bill Wendling
ab55ebda1c Redo the arithmetic with overflow architecture. I was changing the semantics of
ISD::ADD to emit an implicit EFLAGS. This was horribly broken. Instead, replace
the intrinsic with an ISD::SADDO node. Then custom lower that into an
X86ISD::ADD node with a associated SETCC that checks the correct condition code
(overflow or carry). Then that gets lowered into the correct X86::ADDOvf
instruction.

Similar for SUB and MUL instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60915 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 00:56:36 +00:00
Mon P Wang
6db08c4d2f Avoid generating a convert_rndsat node when the src and dest type are the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 03:30:13 +00:00
Bill Wendling
775bb805c5 Clarify FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 01:26:44 +00:00
Mon P Wang
f67303d256 Whitespace clean up (tabs with spaces)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 00:44:22 +00:00
Mon P Wang
a60b5236c1 Make fix for r60829 less conservative to allow the proper optimization for
vec_extract-sse4.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 00:26:16 +00:00
Bill Wendling
0ffa3de9e9 Add a newline after this debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 23:24:43 +00:00
Bill Wendling
2476e5d345 If ADD, SUB, or MUL have an overflow bit that's used, don't do transformation on
them. The DAG combiner expects that nodes that are transformed have one value
result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 22:36:00 +00:00
Duncan Sands
ab0c578bfd For amusement, implement SADDO, SSUBO, UADDO, USUBO
for promoted integer types, eg: i16 on ppc-32, or
i24 on any platform.  Complete support for arbitrary
precision integers would require handling expanded
integer types, eg: i128, but I couldn't be bothered.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 12:30:42 +00:00
Mon P Wang
bae527d949 Fixed a bug when trying to optimize a extract vector element of a
bit convert that changes the number of elements of a shuffle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 03:59:02 +00:00
Evan Cheng
5788d1a169 Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids some overflow issues. Patch by Thomas Jablin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 02:32:19 +00:00
Bill Wendling
bc5e15eafb Whitespace changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 02:01:32 +00:00
Bill Wendling
2ce4e5cadd Whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:28:22 +00:00
Dan Gohman
f55a2101e3 Update CalcLatency to work in terms of edge latencies, rather than
node latencies. Use CalcLatency instead of manual code in
CalculatePriorities to keep it consistent. Previously it
computed slightly different results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:24:36 +00:00
Evan Cheng
94ea5be39f Fix a couple of Dwarf bugs.
- Emit DW_AT_byte_size for struct and union of size zero.
- Emit DW_AT_declaration for forward type declaration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60812 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:15:44 +00:00
Dan Gohman
54e4c36a73 Rewrite the SDep class, and simplify some of the related code.
The Cost field is removed. It was only being used in a very limited way,
to indicate when the scheduler should attempt to protect a live register,
and it isn't really needed to do that. If we ever want the scheduler to
start inserting copies in non-prohibitive situations, we'll have to
rethink some things anyway.

A Latency field is added. Instead of giving each node a single
fixed latency, each edge can have its own latency. This will eventually
be used to model various micro-architecture properties more accurately.

The PointerIntPair class and an internal union are now used, which
reduce the overall size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 22:54:47 +00:00
Dan Gohman
bcf28c08b3 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60804 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 22:45:08 +00:00
Bill Wendling
74c3765291 Add sub/mul overflow intrinsics. This currently doesn't have a
target-independent way of determining overflow on multiplication. It's very
tricky. Patch by Zoltan Varga!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 22:08:41 +00:00
Duncan Sands
47d9dcc584 Fix PR3117: not all nodes being legalized. The
essential problem was that the DAG can contain
random unused nodes which were never analyzed.
When remapping a value of a node being processed,
such a node may become used and need to be analyzed;
however due to operands being transformed during
analysis the node may morph into a different one.
Users of the morphing node need to be updated, and
this wasn't happening.  While there I added a bunch
of documentation and sanity checks, so I (or some
other poor soul) won't have to scratch their head
over this stuff so long trying to remember how it
was all supposed to work next time some obscure
problem pops up!  The extra sanity checking exposed
a few places where invariants weren't being preserved,
so those are fixed too.  Since some of the sanity
checking is expensive, I added a flag to turn it
on.  It is also turned on when building with
ENABLE_EXPENSIVE_CHECKS=1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 21:33:20 +00:00
Evan Cheng
f84802880c Cosmetic changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 17:56:30 +00:00
Dan Gohman
e3a49cd944 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60769 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 16:37:48 +00:00
Mon P Wang
1cd46bbb1c In LegalizeOp, don't change the result type of CONVERT_RNDSAT when promoting
one of its operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 07:27:39 +00:00
Mon P Wang
e9f1015d1f Fix getNode to allow a vector for the shift amount for shifts of vectors.
Fix the shift amount when unrolling a vector shift into scalar shifts.
Fix problem in getShuffleScalarElt where it assumes that the input of
a bit convert must be a vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 05:46:39 +00:00
Dan Gohman
aeac8f9cb4 Don't charge full latency for an anti-dependence, in this simplistic
pipeline model.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:26:46 +00:00
Dan Gohman
a629b48a66 Fix the top-level comments, and fix some 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 17:50:35 +00:00
Dan Gohman
c8a1a3c426 Factor out the code for sign-extending/truncating gep indices
and use it in x86 address mode folding. Also, make
getRegForValue return 0 for illegal types even if it has a
ValueMap for them, because Argument values are put in the
ValueMap. This fixes PR3181.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 07:57:47 +00:00
Dan Gohman
2e3e5bf427 Move createVirtualRegister out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60684 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 04:54:11 +00:00
Dan Gohman
c93ced5b34 Clarify some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 04:53:23 +00:00
Owen Anderson
75c99c5aa8 Switch to top-down mode and fix a crasher this exposed caused by an error in the
live interval updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 05:33:18 +00:00
Evan Cheng
650d7f3ff4 Reason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool into a use, the rewrite happens at time of spill (not in VirtRegMap). Later on, if the GlobalBaseReg is spilled, the spiller can see the use uses GlobalBaseReg and do the right thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60596 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 17:41:31 +00:00
Evan Cheng
72eeb94fe1 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 17:00:16 +00:00
Dan Gohman
2ce7f2068f Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:45:42 +00:00
Dan Gohman
9bf23b5452 Teach StackSlotColoring to update MachineMemOperands when
changing the stack slots on an instruction, to keep them
consistent with the actual memory addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:31:14 +00:00
Dan Gohman
490b1833a9 Ignore IMPLICIT_DEF instructions when computing physreg liveness.
While they appear to provide a normal clobbering def, they don't
in the case of the awkward IMPLICIT_DEF+INSERT_SUBREG idiom. It
would be good to change INSERT_SUBREG; until then, this change
allows post-regalloc scheduling to cope in a mildly conservative
way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:30:02 +00:00
Owen Anderson
6002e993e0 Factor out some common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 21:20:30 +00:00
Duncan Sands
9304f2c294 When allocating a stack temporary, use the correct
number of bytes for types such as i1 which are not
a multiple of 8 bits in length.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 18:08:40 +00:00
Dan Gohman
80e201b8db Use register names instead of numbers in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 02:15:26 +00:00
Dan Gohman
b29ffc8870 Make debug output more informative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 02:14:57 +00:00
Dan Gohman
6a9041e5ca Add minimal support for disambiguating memory references. Currently
the main thing this covers is spills to distinct spill slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 01:35:46 +00:00
Dan Gohman
cef874ae2b Rewrite the liveness bookkeeping code to fix a bunch of
issues with subreg operands and tied operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60510 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 23:07:27 +00:00
Dan Gohman
d71703deec Have PseudoSourceValue override Value::dump, so that it works
on PseudoSourceValue values. This also fixes a FIXME in
lib/VMCode/AsmWriter.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 21:37:21 +00:00
Dan Gohman
e96cc775e4 Fix an inconsistency in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:38:38 +00:00
Dan Gohman
e561751e98 Don't charge the full latency for anti and output dependencies. This is
an area where eventually it would be good to use target-dependent
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60498 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:37:34 +00:00
Dan Gohman
0dba0e5408 When looking for anti-dependences on the critical path, don't bother
examining non-anti-dependence edges.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:32:26 +00:00
Dan Gohman
ebb0a31103 Add a comment about callee-saved registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:30:13 +00:00
Dan Gohman
c54baa2d43 Split foldMemoryOperand into public non-virtual and protected virtual
parts, and add target-independent code to add/preserve
MachineMemOperands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 18:43:12 +00:00
Dan Gohman
15511cf166 Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 18:15:48 +00:00
Duncan Sands
8b8e5a7f96 Only check that the result of the mapping was not
a new node if the node was actually remapped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 12:36:16 +00:00
Rafael Espindola
952b839ce9 Fix bug 3140.
Print a single parameter .file directive if we have an ELF target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 11:01:37 +00:00
Dan Gohman
41474baac8 Add a sanity-check to tablegen to catch the case where isSimpleLoad
is set but mayLoad is not set. Fix all the problems this turned up.

Change code to not use isSimpleLoad instead of mayLoad unless it
really wants isSimpleLoad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 02:30:17 +00:00
Evan Cheng
96da041949 Remove a (what appears to be) overly strict assertion. Here is what happened:
1. ppcf128 select is expanded to f64 select's.
2. f64 select operand 0 is an i1 truncate, it's promoted to i32 zero_extend.
3. f64 select is updated. It's changed back to a "NewNode" and being re-analyzed.
4. f64 select operands are being processed. Operand 0 is a "NewNode". It's being expunged out of ReplacedValues map.
5. ExpungeNode tries to remap f64 select and notice it's a "NewNode" and assert.
Duncan, please take a look. Thanks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 21:57:09 +00:00
Scott Michel
546d7b5c4a Non-functional change: make custom lowering for truncate stylistically
consistent with the way it's generally done in other places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60439 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:55:08 +00:00
Dan Gohman
d118342b25 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:27:20 +00:00
Owen Anderson
7b9d67c5bf Add support for folding spills into preceding defs when doing pre-alloc splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:53:47 +00:00
Dale Johannesen
34d7985927 One more transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:40:40 +00:00
Tilmann Scheller
b0a5cdd451 make it possible to custom lower TRUNCATE (needed for the CellSPU target)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 12:12:25 +00:00
Mon P Wang
fb13f008cb Removed some unnecessary code in widening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 07:35:08 +00:00
Evan Cheng
bbe4105cd7 Fix PR3124: overly strict assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60392 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 02:15:36 +00:00
Dale Johannesen
221cd2f081 Add a few more transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 01:30:54 +00:00
Bill Wendling
13d6d446f6 Expand getVTList, getNodeValueTypes, and SelectNodeTo to handle more value types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60381 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 23:28:22 +00:00
Duncan Sands
aaffa05d0a There are no longer any places that require a
MERGE_VALUES node with only one operand, so get
rid of special code that only existed to handle
that possibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 11:41:29 +00:00
Duncan Sands
1607f05cb7 Change the interface to the type legalization method
ReplaceNodeResults: rather than returning a node which
must have the same number of results as the original
node (which means mucking around with MERGE_VALUES,
and which is also easy to get wrong since SelectionDAG
folding may mean you don't get the node you expect),
return the results in a vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 11:39:25 +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
Nick Lewycky
a89d102b32 Silence a warning.
Despite changing the order of evaluation, this doesn't actually change the
meaning of the statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 17:29:52 +00:00
Sanjiv Gupta
9b0f0b5e15 Removing redundant semicolons. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 05:58:04 +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
Dale Johannesen
56eca9103e Add a missing case in visitADD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:43:21 +00:00
Sanjiv Gupta
d3f01aa5a1 Allow custom lowering of ADDE/ADDC/SUBE/SUBC operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 11:19:00 +00:00
Dan Gohman
2ad8245566 LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:50:31 +00:00
Bill Wendling
740464e616 A simplification for checking whether the signs of the operands and sum differ. Thanks, Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60043 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 19:40:17 +00:00
Dan Gohman
878ef1d5bc Suppress warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 18:53:54 +00:00
Bill Wendling
a6af91ae12 Now with the correct type for the 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 08:19:22 +00:00
Bill Wendling
7ebfea4175 Get rid of unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60015 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 08:13:20 +00:00
Bill Wendling
c0062fb755 Hacker's Delight says, "Signed integer overflow of addition occurs if and only
if the operands have the same sign and the sum has sign opposite to that of the
operands."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60014 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 08:12:19 +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
Bill Wendling
41ea7e7eb3 - Make lowering of "add with overflow" customizable by back-ends.
- Mark "add with overflow" as having a custom lowering for X86. Give it a null
  lowering representation for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:21:46 +00:00
Dan Gohman
942b8c8533 Check in the rest of this change. The isAntiDep flag needs to be passed
to removePred because an SUnit can both data-depend and anti-depend
on the same SUnit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:33:52 +00:00
Dan Gohman
974b5f53f7 Pass the isAntiDep argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59968 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:24:27 +00:00
Dan Gohman
cb72dd6776 Run post-RA scheduling after branch folding, as it tends to
obscure tail-merging opportunities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 17:22:52 +00:00
Matthijs Kooijman
faa3d82a31 Minor fix debug for register allocation debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59961 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 16:01:21 +00:00
Duncan Sands
25cf2275ff If the type legalizer actually legalized anything
(this doesn't happen that often, since most code
does not use illegal types) then follow it by a
DAG combiner run that is allowed to generate
illegal operations but not illegal types.  I didn't
modify the target combiner code to distinguish like
this between illegal operations and illegal types,
so it will not produce illegal operations as well
as not producing illegal types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 14:53:14 +00:00
Evan Cheng
24ac408ce8 Eliminate some unused variable compile time warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 07:09:49 +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
Duncan Sands
03228089d5 Rename SetCCResultContents to BooleanContents. In
practice these booleans are mostly produced by SetCC,
however the concept is more general.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 15:47:28 +00:00
Mon P Wang
6cce3dae90 Added check to avoid generating extract subvector beyond the end of the vector when normalizing vector shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59900 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 04:35:05 +00:00
Anton Korobeynikov
7751ad92da Make a convenient helper for printing offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 16:15:34 +00:00