1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

6843 Commits

Author SHA1 Message Date
Evan Cheng
1d07cd32c2 Undo spill weight tweak. Need to investigate the performance regressions.
llvm-svn: 52572
2008-06-21 06:45:54 +00:00
Duncan Sands
57f1b4e23c Add some methods for querying the nature of a
store, like the methods for loads (and neaten
those up a bit while there).

llvm-svn: 52547
2008-06-20 18:34:30 +00:00
Dan Gohman
f62b13bc3d Add an allnodes_size method.
llvm-svn: 52541
2008-06-20 16:03:16 +00:00
Gordon Henriksen
50ca4ebe97 Add C binding for ExecutionEngine::addGlobalMapping.
llvm-svn: 52523
2008-06-20 02:16:11 +00:00
Dan Gohman
d61d67b75c It's invalid to take the one-past-the-end address of a non-array
object.

llvm-svn: 52515
2008-06-20 00:49:21 +00:00
Owen Anderson
5eeafbc3f7 Add an idx_iterator to the insertvalue and extractvalue instructions.
llvm-svn: 52493
2008-06-19 17:15:57 +00:00
Dan Gohman
42e4ecff62 The inline keyword goes before the return type. This fixes a compiler warning.
llvm-svn: 52492
2008-06-19 16:16:06 +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
Dan Gohman
606a60ad68 Move SCEVExpander::visitAddExpr out-of-line.
llvm-svn: 52464
2008-06-18 16:37:11 +00:00
Dan Gohman
82f9df016e Move LSR's private isZero function to a public SCEV member
function, and make use of it in several places.

llvm-svn: 52463
2008-06-18 16:23:07 +00:00
Evan Cheng
e447be0532 Add MachineRegisterInfo::use_empty.
llvm-svn: 52451
2008-06-18 07:47:55 +00:00
Devang Patel
960d6ae6d1 Check empty dominance frontier.
llvm-svn: 52437
2008-06-18 02:12:09 +00:00
Dan Gohman
c190d65454 Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.

llvm-svn: 52435
2008-06-17 23:38:43 +00:00
Owen Anderson
79605db969 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.

llvm-svn: 52424
2008-06-17 18:29:27 +00:00
Owen Anderson
609a53ac86 Fix use of placement new to actually use an address.
llvm-svn: 52423
2008-06-17 18:07:43 +00:00
Anton Korobeynikov
5b04f6d658 Provide generic hooks for icache invalidation. Add PPC implementation.
Patch by Gary Benson!

llvm-svn: 52418
2008-06-17 17:30:05 +00:00
Matthijs Kooijman
44440c3722 Forgot to commit the ValueTracking header file along with r52396.
llvm-svn: 52401
2008-06-17 13:54:33 +00:00
Matthijs Kooijman
2fba6e78d6 80 column fixes.
llvm-svn: 52391
2008-06-17 08:26:32 +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
Evan Cheng
4e7b7b21a2 Horizontal-add instructions are not commutative.
llvm-svn: 52363
2008-06-16 21:16:24 +00:00
Gabor Greif
ae2be0f217 Move some documentation from the header file into ProgrammersManual. About to improve.
llvm-svn: 52360
2008-06-16 21:06:12 +00:00
Evan Cheng
d27948e716 - Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding.

llvm-svn: 52353
2008-06-16 20:29:38 +00:00
Chris Lattner
b2c9317b8d Add a new flag that disables symbol lookup with dlsym when set. This allows
a JIT client to completely control symbol lookup with the LazyFunctionCreator
interface.

llvm-svn: 52335
2008-06-16 17:44:14 +00:00
Matthijs Kooijman
544c9b2fb0 Make the InsertBefore argument to FindInsertedValue optional, so you can find an inserted value without modifying the code.
llvm-svn: 52319
2008-06-16 13:28:31 +00:00
Matthijs Kooijman
238b1e8d69 Pass around Instruction* instead of Instruction& in FindInsertedValue and friends.
llvm-svn: 52318
2008-06-16 13:13:08 +00:00
Matthijs Kooijman
1dd7d9cdc1 Move FindScalarValue from InstructionCombining.cpp to ValueTracking.cpp. While
I'm at it, rename it to FindInsertedValue.

The only functional change is that newly created instructions are no longer
added to instcombine's worklist, but that is not really necessary anyway (and
I'll commit some improvements next that will completely remove the need).

llvm-svn: 52315
2008-06-16 12:48:21 +00:00
Matthijs Kooijman
fedd2bd496 Add comment.
llvm-svn: 52313
2008-06-16 12:20:05 +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
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
Chris Lattner
ffb6425556 add a const version of stripPointerCasts
llvm-svn: 52305
2008-06-16 06:43:06 +00:00
Wojciech Matyjewicz
58f5cc8864 Fix PR2434. When scanning for exising binary operator to reuse don't
take into account the instrucion pointed by InsertPt. Thanks to it, 
returning the new value of InsertPt to the InsertBinop() caller can be 
avoided. The bug was, actually, in visitAddRecExpr() method which wasn't 
correctly handling changes of InsertPt. There shouldn't be any 
performance regression, as -gvn pass (run after -indvars) removes any 
redundant binops.

llvm-svn: 52291
2008-06-15 19:07:39 +00:00
Andrew Lenharth
327c3e7559 add missing atomic intrinsic from gcc
llvm-svn: 52270
2008-06-14 05:48:15 +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
Nick Lewycky
0aa53f2b52 Crash less. The i64 restriction in BinomialCoefficient caused some problems
with code that was expecting different bit widths for different values.

Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it.

llvm-svn: 52248
2008-06-13 04:38:55 +00:00
Evan Cheng
5897328890 Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
llvm-svn: 52244
2008-06-12 21:15:59 +00:00
Duncan Sands
e52bc54496 If queried as to whether an operation is legal
for a particular MVT, return false if the type
is illegal rather than barfing.

llvm-svn: 52229
2008-06-12 09:01:30 +00:00
Gabor Greif
c3d97cdecc remove bogus comment
llvm-svn: 52216
2008-06-11 13:53:41 +00:00
Gabor Greif
8617cb5391 op_iterator-ify dropAllReferences
llvm-svn: 52215
2008-06-11 11:45:26 +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
Duncan Sands
dd16b1d024 Small doc fix.
llvm-svn: 52190
2008-06-10 20:54:01 +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
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
Chris Lattner
ed8780055e Add a simple, but efficient, generic scoped hash table
llvm-svn: 52112
2008-06-09 00:42:10 +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
Gabor Greif
7c2e365dbc get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
llvm-svn: 52064
2008-06-06 21:06:32 +00:00
Gabor Greif
8ac103e71d make ExtractValueInst derived from UnaryInstruction
llvm-svn: 52061
2008-06-06 20:28:12 +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
Chris Lattner
67a5a4eba8 Expose a public interface to this pass.
llvm-svn: 52029
2008-06-05 23:45:18 +00:00