1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

5108 Commits

Author SHA1 Message Date
Dan Gohman
cd78a0e385 Use the transferSuccessors helper function.
llvm-svn: 52495
2008-06-19 17:22:29 +00:00
Evan Cheng
b12290e31b Missed a check.
llvm-svn: 52487
2008-06-19 06:17:19 +00:00
Owen Anderson
864a2c23ed Revert my last patch, which was causing regression test failures.
llvm-svn: 52485
2008-06-19 05:29:34 +00:00
Evan Cheng
22b431d28f Coalesce copy from one register class to a sub register class. e.g. X86::MOV16to16_.
llvm-svn: 52480
2008-06-19 01:39:21 +00:00
Evan Cheng
f129d15d03 Cosmetic changes.
llvm-svn: 52479
2008-06-19 01:21:26 +00:00
Evan Cheng
968679913e Minor spiller tweak to unfavor reload into load/store instructions.
llvm-svn: 52477
2008-06-19 01:16:17 +00:00
Owen Anderson
abbc43e493 Insert empty slots into the instruction numbering in live intervals, so that we can more easily
add new instructions.

llvm-svn: 52475
2008-06-19 00:10:49 +00:00
Argyrios Kyrtzidis
5ef6b9b977 Fix the source line debug information for the Windows platform.
According to DWARF-2 specification, the line information is provided through an offset in the .debug_line section.
Replace the label reference that is used with a section offset.

llvm-svn: 52468
2008-06-18 19:27:37 +00:00
Evan Cheng
ad0a4a31f8 Complete support for two-address pass rematerialization. Now *almost* always a win.
llvm-svn: 52452
2008-06-18 07:49:14 +00:00
Evan Cheng
cba32609d2 Cosmetic.
llvm-svn: 52450
2008-06-18 07:47:28 +00:00
Evan Cheng
10ead77866 Live-through live interval is [mbb start, mbb end+1].
llvm-svn: 52431
2008-06-17 20:13:36 +00:00
Evan Cheng
3dc2cfe366 When extending a liveinterval by commuting, don't throw away the live ranges that are not affected.
llvm-svn: 52430
2008-06-17 20:11:16 +00:00
Evan Cheng
acd28b95da It's not safe to remove SUBREG_TO_REG that looks like identity copies, e.g. movl %eax, %eax on x86-64 actually does a zero-extend.
llvm-svn: 52421
2008-06-17 17:59:16 +00:00
Duncan Sands
ae9d876e69 Split type expansion into ExpandInteger and ExpandFloat
rather than bundling them together.  Rename FloatToInt
to PromoteFloat (better, if not perfect).  Reorganize
files by types rather than by operations.

llvm-svn: 52408
2008-06-17 14:27:01 +00:00
Chris Lattner
f461cca6b7 add a new -enable-value-prop flag for llcbeta, that enables propagation
of value info (sign/zero ext info) from one MBB to another.  This doesn't
handle much right now because of two limitations:

1) only handles zext/sext, not random bit propagation (no assert exists 
   for this)
2) doesn't handle phis.

llvm-svn: 52383
2008-06-17 06:09:18 +00:00
Duncan Sands
915b66e08b Fix spelling.
llvm-svn: 52381
2008-06-17 03:24:13 +00:00
Evan Cheng
8cfd1d39a1 Do not issue identity copies.
llvm-svn: 52373
2008-06-16 22:52:53 +00:00
Owen Anderson
63a604a316 Remove special case handling of empty MBBs now that we assign indices to them.
llvm-svn: 52345
2008-06-16 19:32:40 +00:00
Owen Anderson
3c4bb80d78 Re-enable empty block indexing by default, since it doesn't seem to have any
impact on code quality or compile time.

llvm-svn: 52329
2008-06-16 16:58:24 +00:00
Duncan Sands
78bdcc813e Allow these transforms for types like i256 while
still excluding types like i1 (not byte sized)
and i120 (loading an i120 requires loading an i64,
an i32, an i16 and an i8, which is expensive). 

llvm-svn: 52310
2008-06-16 08:14:38 +00:00
Evan Cheng
93d91a771c Fix read after free found by valgrind.
llvm-svn: 52309
2008-06-16 07:34:17 +00:00
Evan Cheng
2dfe8c2435 Add option to commuteInstruction() which forces it to create a new (commuted) instruction.
llvm-svn: 52308
2008-06-16 07:33:11 +00:00
Owen Anderson
114ce854d1 Make indexing empty basic blocks an option for the moment.
llvm-svn: 52306
2008-06-16 07:10:49 +00:00
Owen Anderson
1077c28bb1 Assign indices to empty basic blocks. This will be necessary for StrongPHIElimination in the near future.
llvm-svn: 52300
2008-06-16 06:18:41 +00:00
Duncan Sands
2dffe1cc15 The transforms in visitEXTRACT_VECTOR_ELT are
not valid if the load is volatile.  Hopefully
all wrong DAG combiner transforms of volatile
loads and stores have now been caught.

llvm-svn: 52293
2008-06-15 20:12:31 +00:00
Duncan Sands
2671518b8b LegalizeTypes support for INSERT_VECTOR_ELT with
a non-constant index.

llvm-svn: 52292
2008-06-15 20:00:14 +00:00
Duncan Sands
fa6e02c4dc Remove a redundant AfterLegalize check. Turn
on some code when !AfterLegalize - but since
this whole code section is turned off by an
"if (0)" it's not really turning anything on.

llvm-svn: 52276
2008-06-14 17:48:34 +00:00
Andrew Lenharth
327c3e7559 add missing atomic intrinsic from gcc
llvm-svn: 52270
2008-06-14 05:48:15 +00:00
Evan Cheng
2e99c9cbf8 Teach the spiller to commute instructions in order to fold a reload. This hits 410 times on 444.namd and 122 times on 252.eon.
llvm-svn: 52266
2008-06-13 23:58:02 +00:00
Duncan Sands
40c8db881a Disable some DAG combiner optimizations that may be
wrong for volatile loads and stores.  In fact this
is almost all of them!  There are three types of
problems: (1) it is wrong to change the width of
a volatile memory access.  These may be used to
do memory mapped i/o, in which case a load can have
an effect even if the result is not used.  Consider
loading an i32 but only using the lower 8 bits.  It
is wrong to change this into a load of an i8, because
you are no longer tickling the other three bytes.  It
is also unwise to make a load/store wider.  For
example, changing an i16 load into an i32 load is
wrong no matter how aligned things are, since the
fact of loading an additional 2 bytes can have
i/o side-effects.  (2) it is wrong to change the
number of volatile load/stores: they may be counted
by the hardware.  (3) it is wrong to change a volatile
load/store that requires one memory access into one
that requires several.  For example on x86-32, you
can store a double in one processor operation, but to
store an i64 requires two (two i32 stores).  In a
multi-threaded program you may want to bitcast an i64
to a double and store as a double because that will
occur atomically, and be indivisible to other threads.
So it would be wrong to convert the store-of-double
into a store of an i64, because this will become two
i32 stores - no longer atomic.  My policy here is
to say that the number of processor operations for
an illegal operation is undefined.  So it is alright
to change a store of an i64 (requires at least two
stores; but could be validly lowered to memcpy for
example) into a store of double (one processor op).
In short, if the new store is legal and has the same
size then I say that the transform is ok.  It would
also be possible to say that transforms are always
ok if before they were illegal, whether after they
are illegal or not, but that's more awkward to do
and I doubt it buys us anything much.
However this exposed an interesting thing - on x86-32
a store of i64 is considered legal!  That is because
operations are marked legal by default, regardless of
whether the type is legal or not.  In some ways this
is clever: before type legalization this means that
operations on illegal types are considered legal;
after type legalization there are no illegal types
so now operations are only legal if they really are.
But I consider this to be too cunning for mere mortals.
Better to do things explicitly by testing AfterLegalize.
So I have changed things so that operations with illegal
types are considered illegal - indeed they can never
map to a machine operation.  However this means that
the DAG combiner is more conservative because before
it was "accidentally" performing transforms where the
type was illegal because the operation was nonetheless
marked legal.  So in a few such places I added a check
on AfterLegalize, which I suppose was actually just
forgotten before.  This causes the DAG combiner to do
slightly more than it used to, which resulted in the X86
backend blowing up because it got a slightly surprising
node it wasn't expecting, so I tweaked it.

llvm-svn: 52254
2008-06-13 19:07:40 +00:00
Duncan Sands
2a9c84481c Sometimes (rarely) nodes held in LegalizeTypes
maps can be deleted.  This happens when RAUW
replaces a node N with another equivalent node
E, deleting the first node.  Solve this by
adding (N, E) to ReplacedNodes, which is already
used to remap nodes to replacements.  This means
that deleted nodes are being allowed in maps,
which can be delicate: the memory may be reused
for a new node which might get confused with the
old deleted node pointer hanging around in the
maps, so detect this and flush out maps if it
occurs (ExpungeNode).  The expunging operation
is expensive, however it never occurs during
a llvm-gcc bootstrap or anywhere in the nightly
testsuite.  It occurs three times in "make check":
Alpha/illegal-element-type.ll,
PowerPC/illegal-element-type.ll and
X86/mmx-shift.ll.  If expunging proves to be too
expensive then there are other more complicated
ways of solving the problem.
In the normal case this patch adds the overhead
of a few more map lookups, which is hopefully
negligable.

llvm-svn: 52214
2008-06-11 11:42:12 +00:00
Dan Gohman
c87fbbd014 Teach isGAPlusOffset to respect a GlobalAddressSDNode's offset
value, which is something that apparently isn't used much.

llvm-svn: 52158
2008-06-09 22:05:52 +00:00
Dan Gohman
8c089d4df6 CodeGen support for aggregate-value function arguments.
llvm-svn: 52156
2008-06-09 21:19:23 +00:00
Duncan Sands
e46308480d Various tweaks related to apint codegen. No functionality
change for non-funky-sized integers.

llvm-svn: 52151
2008-06-09 15:48:25 +00:00
Dan Gohman
d789392934 Handle empty aggregate values.
llvm-svn: 52150
2008-06-09 15:21:47 +00:00
Duncan Sands
a487df7710 Remove some DAG combiner assumptions about sizes
of integer types.  Fix the isMask APInt method to
actually work (hopefully) rather than crashing
because it adds apints of different bitwidths.
It looks like isShiftedMask is also broken, but
I'm leaving that one to the APInt people (it is
not used anywhere).

llvm-svn: 52142
2008-06-09 11:32:28 +00:00
Duncan Sands
fe2a970a5c Remove comparison methods for MVT. The main cause
of apint codegen failure is the DAG combiner doing
the wrong thing because it was comparing MVT's using
< rather than comparing the number of bits.  Removing
the < method makes this mistake impossible to commit.
Instead, add helper methods for comparing bits and use
them.

llvm-svn: 52098
2008-06-08 20:54:56 +00:00
Dan Gohman
d4e2736532 CodeGen support for insertvalue and extractvalue, and for loads and
stores of aggregate values.

llvm-svn: 52069
2008-06-07 02:02:36 +00:00
Owen Anderson
a18629b9c6 Connect successors before creating the DAG node for the branch. This has
no visible functionality change, but enables a future patch where node creation
will update the CFG if it decides to create an unconditional rather than a conditional branch.

llvm-svn: 52067
2008-06-07 00:00:23 +00:00
Evan Cheng
d919d1ecd8 Enable stack coloring by default.
llvm-svn: 52057
2008-06-06 19:52:44 +00:00
Duncan Sands
c19b5155ea Tighten up the abstraction slightly.
llvm-svn: 52045
2008-06-06 12:49:32 +00:00
Duncan Sands
d634afe3aa Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).

llvm-svn: 52044
2008-06-06 12:08:01 +00:00
Evan Cheng
fe06a1fd5b Refine stack slot interval weight computation.
llvm-svn: 52040
2008-06-06 07:54:39 +00:00
Owen Anderson
6b49b2db48 Remove debugging code.
llvm-svn: 52016
2008-06-05 18:43:34 +00:00
Owen Anderson
18ca5de680 Use the newly created helper on LiveIntervals.
llvm-svn: 52013
2008-06-05 17:22:53 +00:00
Owen Anderson
08c0c02c20 Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
llvm-svn: 52012
2008-06-05 17:15:43 +00:00
Evan Cheng
e77d6a1a2d Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller.
llvm-svn: 51970
2008-06-04 23:37:54 +00:00
Evan Cheng
a9cf0ff766 Oops. Should not be enabled by default.
llvm-svn: 51953
2008-06-04 18:09:20 +00:00
Owen Anderson
503cf18547 Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.
llvm-svn: 51950
2008-06-04 17:55:58 +00:00
Evan Cheng
9048a25037 Revert this.
llvm-svn: 51949
2008-06-04 17:21:44 +00:00