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

4237 Commits

Author SHA1 Message Date
Dan Gohman
2d61a3f384 Refine #includes.
llvm-svn: 101269
2010-04-14 18:49:17 +00:00
Dan Gohman
b0b1974ddd Pull utility routines with no SelectionDAG dependence out of
SelectionDAGBuilder. FunctionLoweringInfo isn't an ideal place for
them to live, but it's better than SelectionDAGBuilder for now.

llvm-svn: 101267
2010-04-14 18:31:02 +00:00
Dan Gohman
64582fc238 Fix typos in comments.
llvm-svn: 101266
2010-04-14 18:24:06 +00:00
Dan Gohman
60b5b8fa20 Delete an obsolete comment.
llvm-svn: 101264
2010-04-14 17:40:25 +00:00
Dan Gohman
4fd4153d52 Delete an unused function.
llvm-svn: 101263
2010-04-14 17:22:02 +00:00
Dan Gohman
45b0642839 Clear the FunctionLoweringInfo object before doing other things that
don't need it.

llvm-svn: 101262
2010-04-14 17:13:16 +00:00
Dan Gohman
3738dc7587 Move this assert out of SelectionDAGISel into FunctionLoweringInfo, and
drop the redundant #ifndef NDEBUG.

llvm-svn: 101261
2010-04-14 17:11:23 +00:00
Dan Gohman
4374fdf868 Add a comment.
llvm-svn: 101260
2010-04-14 17:09:37 +00:00
Dan Gohman
d0c66476e1 Move the code for initialing the entry block livein set out of
SelectionDAGISel.

llvm-svn: 101258
2010-04-14 17:05:00 +00:00
Dan Gohman
859cb3eea9 Reorgnaize this code to be more tidy and readable.
llvm-svn: 101256
2010-04-14 17:02:07 +00:00
Dan Gohman
a1656764cc Trim #includes.
llvm-svn: 101255
2010-04-14 16:54:39 +00:00
Dan Gohman
2c09c272ff Move the code for emitting livein copies out of SelectionDAGISel.
llvm-svn: 101254
2010-04-14 16:51:49 +00:00
Dan Gohman
6471bcb1fd Sink landing-pad marking code out of
SelectionDAGISel::runOnMachineFunction into FunctionLowering.

llvm-svn: 101252
2010-04-14 16:32:56 +00:00
Dan Gohman
625913100a It's not necessary to recompute EB here.
llvm-svn: 101251
2010-04-14 16:30:40 +00:00
Dan Gohman
1158c51fe0 Generalize this code to handle Instructions in addition to ConstantExprs.
llvm-svn: 101210
2010-04-14 02:33:23 +00:00
Dan Gohman
f3d8d6ef18 Reorder the methods of this class to be a little more organized.
llvm-svn: 101206
2010-04-14 02:09:45 +00:00
Dan Gohman
a400b6eca8 Add a few comments.
llvm-svn: 101148
2010-04-13 17:07:06 +00:00
Dan Gohman
5c9f7ed9aa Remove unnecessary parens.
llvm-svn: 101010
2010-04-12 02:24:01 +00:00
Dan Gohman
127f5c53e1 Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.
llvm-svn: 100824
2010-04-08 23:03:40 +00:00
Ted Kremenek
141d32b7e9 Fix -Wsign-compare warning (issued by clang++).
llvm-svn: 100799
2010-04-08 18:49:30 +00:00
Benjamin Kramer
0fb23008bb Use twines to simplify calls to report_fatal_error. For code size and readability.
llvm-svn: 100756
2010-04-08 10:44:28 +00:00
Evan Cheng
3fa0b6fb03 Avoid using f64 to lower memcpy from constant string. It's cheaper to use i32 store of immediates.
llvm-svn: 100751
2010-04-08 07:37:57 +00:00
Chris Lattner
579e7eb423 convert a report_fatal_error that I was able to trigger into a nice error
so the user at least knows what inline asm is a problem.  For example:

error: inline asm not supported yet: don't know how to handle tied indirect register inputs
pr8788-1.c:14:10: note: generated from here
    asm ("\n" : "+r" (stack->regs)
         ^

Instead of:
fatal error: error in backend: Don't know how to handle tied indirect register inputs yet!

llvm-svn: 100731
2010-04-08 00:09:16 +00:00
Chris Lattner
f9fbc74e40 minor tidying.
llvm-svn: 100725
2010-04-07 23:50:38 +00:00
Chris Lattner
96ed85d7ab use assertions instead of unreachable for logic errors.
llvm-svn: 100724
2010-04-07 23:47:51 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
Chris Lattner
f520500a06 fix 80 col violation, patch by Alastair Lynn
llvm-svn: 100639
2010-04-07 18:13:33 +00:00
Chris Lattner
122572e13a Have the inst emitter add the !srcloc mdnode to the machine instr.
Have the asmprinter use the mdnode to scavenge a source location if
present.  Document this nonsense in langref.

llvm-svn: 100607
2010-04-07 05:38:05 +00:00
Chris Lattner
dde7376e9d Three changes:
1. Introduce some enums and accessors in the InlineAsm class
   that eliminate a ton of magic numbers when handling inline
   asm SDNode.
2. Add a new MDNodeSDNode selection dag node type that holds
   a MDNode (shocking!)
3. Add a new argument to ISD::INLINEASM nodes that hold !srcloc
   metadata, propagating it to the instruction emitter, which
   drops it.

No functionality change.

llvm-svn: 100605
2010-04-07 05:20:54 +00:00
Dale Johannesen
c0f9c29448 Move printing of target-indepedent DEBUG_VALUE comments
into AsmPrinter.  Target-dependent form is still generated
by FastISel and still handled in X86 code.

llvm-svn: 100596
2010-04-07 01:15:14 +00:00
Dale Johannesen
fef6eb4076 Allow for the possibility that a debug-value points
to a SDNode that didn't have code generated for it.

llvm-svn: 100566
2010-04-06 21:59:56 +00:00
Mon P Wang
c0da8af5c3 Remove assert to treat memmove and memset like memcpy
llvm-svn: 100521
2010-04-06 08:27:51 +00:00
Evan Cheng
c6dc63d62c Fix an obvious copy-n-paste bug. It's not known to cause any miscompilation.
llvm-svn: 100494
2010-04-05 23:33:29 +00:00
Dan Gohman
302746a632 Add a comment.
llvm-svn: 100459
2010-04-05 20:24:08 +00:00
Chris Lattner
7d609ea6cb lowering a volatile llvm.memcpy to a libc memcpy is ok.
PR6779

llvm-svn: 100457
2010-04-05 20:11:45 +00:00
Chris Lattner
aa58ed7c00 remove the now-redundant MMI pointer in SelectionDAG.
llvm-svn: 100419
2010-04-05 06:19:28 +00:00
Chris Lattner
097a332684 remove some redundant MMI arguments.
llvm-svn: 100417
2010-04-05 06:10:13 +00:00
Chris Lattner
6f3c3f60ce unthread MMI from FastISel
llvm-svn: 100416
2010-04-05 06:05:26 +00:00
Chris Lattner
248e65ec05 trim some spurious references to DwarfWriter. SDIsel really doesn't
need it anymore, so don't addRequire it.

llvm-svn: 100400
2010-04-05 04:09:20 +00:00
Chris Lattner
c930f73b4d selection dag doesn't need DwarfWriter, remove some tendrils.
llvm-svn: 100382
2010-04-05 02:23:33 +00:00
Chris Lattner
1fda8b3a8b fastisel doesn't need DwarfWriter, remove some tendricles.
llvm-svn: 100381
2010-04-05 02:19:28 +00:00
Mon P Wang
484bbe6aa9 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100304
2010-04-04 03:10:48 +00:00
Benjamin Kramer
88e421e531 Fix anachronism.
llvm-svn: 100225
2010-04-02 20:47:05 +00:00
Chris Lattner
9da2b8a955 fix the llvm-x86_64-linux buildbot.
llvm-svn: 100223
2010-04-02 20:36:25 +00:00
Chris Lattner
0da97990f6 stop using DebugLoc::getUnknownLoc()
llvm-svn: 100215
2010-04-02 20:17:23 +00:00
Chris Lattner
305c84b8ee Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.

llvm-svn: 100209
2010-04-02 19:42:39 +00:00
Evan Cheng
5d825988d0 Correctly lower memset / memcpy of undef. It should be a nop. PR6767.
llvm-svn: 100208
2010-04-02 19:36:14 +00:00
Mon P Wang
0ccf050ca3 Revert r100191 since it breaks objc in clang
llvm-svn: 100199
2010-04-02 18:43:02 +00:00
Mon P Wang
a01350755e Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100191
2010-04-02 18:04:15 +00:00
Evan Cheng
9307af84c2 Skip checking preferred alignment of GVs defined in other translation units all together.
llvm-svn: 100133
2010-04-01 20:13:28 +00:00
Evan Cheng
8728924812 - Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.

llvm-svn: 100118
2010-04-01 18:19:11 +00:00
Evan Cheng
562bb43207 Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores.
2. Avoid unaligned loads / stores unless it's fast.
3. Fix some memcpy lowering logic bug related to when to optimize a
   load from constant string into a constant.
4. Adjust x86 memcpy lowering threshold to make it more sane.
5. Fix x86 target hook so it uses vector and floating point memory
   ops more effectively.
rdar://7774704

llvm-svn: 100090
2010-04-01 06:04:33 +00:00
Chris Lattner
1d2ea2510d use the optimized debug info apis in sdisel.
llvm-svn: 99986
2010-03-31 04:24:50 +00:00
Chris Lattner
27c9cacb63 add new apis for getting/setting !dbg metadata on
instructions.  In addition to being a convenience,
they are faster than the old apis, particularly when
not going from an MDKindID like people should be
doing.

llvm-svn: 99982
2010-03-31 03:34:40 +00:00
Bob Wilson
aae933cc81 Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
llvm-svn: 99948
2010-03-30 22:27:04 +00:00
Mon P Wang
9351ea594a Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.

llvm-svn: 99928
2010-03-30 20:55:56 +00:00
Evan Cheng
6286e43067 Funky indentation.
llvm-svn: 99901
2010-03-30 18:08:53 +00:00
Evan Cheng
b1ddb193c7 Fix PR4975. Avoid referencing empty vector.
llvm-svn: 99840
2010-03-29 21:27:30 +00:00
Evan Cheng
aafcb722f9 Pool allocate SDDbgValue nodes.
llvm-svn: 99836
2010-03-29 20:48:30 +00:00
Chris Lattner
24b8a8bebd add a statistic for the # times isel has to backtrack.
llvm-svn: 99774
2010-03-28 19:46:56 +00:00
Chris Lattner
5ad69fe4b6 finally remove the immAllOnesV_bc/immAllZerosV_bc patterns
and those derived from them.  These are obnoxious because
they were written as: PatLeaf<(bitconvert).  Not having an
argument was foiling adding better type checking for operand
count matching up with what was required (in this case,
bitconvert always requires an operand!)

llvm-svn: 99759
2010-03-28 08:43:23 +00:00
Chris Lattner
78dc3c322f comply with the wishes of a fixme.
llvm-svn: 99742
2010-03-28 05:55:17 +00:00
Chris Lattner
918dd19018 now that (parallel) is gone and a variety of bugs in targets
are cleaned up, we can remove an old fixme.

llvm-svn: 99741
2010-03-28 05:54:03 +00:00
Chris Lattner
3f060e3216 add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and
1, 1 cases which are by-far the most frequent.  This shrinks the X86
isel table from 77014 -> 74657 bytes.

llvm-svn: 99740
2010-03-28 05:50:16 +00:00
Chris Lattner
bacf4edba3 don't add nodes to the now-dead nodes list multiple times, this
can cause a crash on crazy situations in msp430 when morph-node-to
is disabled.

llvm-svn: 99739
2010-03-28 05:28:31 +00:00
Chris Lattner
bb65543f01 don't add flag nodes with chain results to the NowDeadNodes
list multiple times when MorphNodeTo can't be applied.

llvm-svn: 99735
2010-03-28 04:54:33 +00:00
Chris Lattner
85756c913d improve -debug-only=isel comments for cases when we don't enter a
scope due to obviously false predicate.

llvm-svn: 99723
2010-03-27 18:54:50 +00:00
Bill Wendling
3f00f8044f Forgot the part where we handle the ".llvm.eh.catch.all.value".
llvm-svn: 99697
2010-03-27 01:24:30 +00:00
Anton Korobeynikov
add7caa0f3 Add few missed libcalls and correct names for others.
llvm-svn: 99656
2010-03-26 21:32:14 +00:00
Evan Cheng
1f419ac4da LiveVariables should clear kill / dead markers first. This allows us to remove a hack in the scheduler.
llvm-svn: 99597
2010-03-26 02:12:24 +00:00
Chris Lattner
bea905d2e9 fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
the custom insertion hook deletes the instruction, then we try to set dead
flags on it.  Neither the code that I added nor the code that was there 
before was safe.

llvm-svn: 99538
2010-03-25 18:49:10 +00:00
Evan Cheng
8c19404e5c Scheduler assumes SDDbgValue nodes are in source order. That's true currently. But add an assertion to verify it.
llvm-svn: 99501
2010-03-25 07:16:57 +00:00
Chris Lattner
13f444cdf1 Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte.  This is important because
we're running up to too many opcodes to fit in a byte
and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE
making the numbering sparse.  This just bites the
bullet and bloats out the table.  In practice, this
increases the size of the x86 isel table from 74.5K
to 76K.  I think we'll cope :)

This fixes rdar://7791648

llvm-svn: 99494
2010-03-25 06:33:05 +00:00
Evan Cheng
0ad874a05c Remove a fixme that doesn't make sense any more.
llvm-svn: 99489
2010-03-25 06:02:53 +00:00
Evan Cheng
0917f4a575 Make sure SDDbgValue.Invalid is initialized to false by all the constructors.
llvm-svn: 99487
2010-03-25 05:50:26 +00:00
Chris Lattner
391902aa30 Make the NDEBUG assertion stronger and more clear what is
happening.

Enhance scheduling to set the DEAD flag on implicit defs
more aggressively.  Before, we'd set an implicit def operand
to dead if it were present in the SDNode corresponding to
the machineinstr but had no use.  Now we do it in this case
AND if the implicit def does not exist in the SDNode at all.

This exposes a couple of problems: one is the FIXME, which
causes a live intervals crash on CodeGen/X86/sibcall.ll.
The second is that it makes machinecse and licm more 
aggressive (which is a good thing) but also exposes a case
where licm hoists a set0 and then it doesn't get resunk.

Talking to codegen folks about both these issues, but I need
this patch in in the meantime.

llvm-svn: 99485
2010-03-25 05:40:48 +00:00
Chris Lattner
7382099e8f reapply 99444/99445, which I speculatively reverted in
r99453.

llvm-svn: 99482
2010-03-25 04:41:16 +00:00
Evan Cheng
abefdb6d68 Change how dbg_value sdnodes are converted into machine instructions. Their placement should be determined by the relative order of incoming llvm instructions. The scheduler will now use the SDNode ordering information to determine where to insert them. A dbg_value instruction is inserted after the instruction with the last highest source order and before the instruction with the next highest source order. It will optimize the placement by inserting right after the instruction that produces the value if they have consecutive order numbers.
Here is a theoretical example that illustrates why the placement is important.

tmp1 = 
store tmp1 -> x
...
tmp2 = add ...
...
call
...
store tmp2 -> x

Now mem2reg comes along:

tmp1 = 
dbg_value (tmp1 -> x)
...
tmp2 = add ...
...
call
...
dbg_value (tmp2 -> x)

When the debugger examine the value of x after the add instruction but before the call, it should have the value of tmp1.

Furthermore, for dbg_value's that reference constants, they should not be emitted at the beginning of the block (since they do not have "producers").

This patch also cleans up how SDISel manages DbgValue nodes. It allow a SDNode to be referenced by multiple SDDbgValue nodes. When a SDNode is deleted, it uses the information to find the SDDbgValues and invalidate them. They are not deleted until the corresponding SelectionDAG is destroyed.

llvm-svn: 99469
2010-03-25 01:38:16 +00:00
Chris Lattner
0bbe76ccc4 revert 99444/99445. This doesn't cause the failure of
2006-07-19-stwbrx-crash.ll for me, but it's the only likely
patch in the blame list of several bots.  Lets see if this
fixes it.

llvm-svn: 99453
2010-03-24 23:41:19 +00:00
Chris Lattner
c7a6ab89fb remove dead argument.
llvm-svn: 99445
2010-03-24 22:47:12 +00:00
Chris Lattner
d581e0398e split EmitNode in half to reduce indentation.
llvm-svn: 99444
2010-03-24 22:45:47 +00:00
Dan Gohman
56a90ff2a1 Remove the ConvertActions table and associated code, which is unused.
llvm-svn: 99372
2010-03-24 00:53:38 +00:00
Dan Gohman
ce6d4394a8 Revert 99335. getTypeToExpandTo's iterative behavior is actually
needed here.

llvm-svn: 99339
2010-03-23 22:44:42 +00:00
Dan Gohman
7814ddee81 Remove getTypeToExpandTo, since it isn't adding much value
beyond just calling getTypeToTransformTo.

llvm-svn: 99335
2010-03-23 22:15:31 +00:00
Mon P Wang
005a544af8 Fixed a widening bug where we were not using the correct size for the load
llvm-svn: 98920
2010-03-19 01:19:52 +00:00
Anton Korobeynikov
23c07f492e Get rid of target-specific nodes for fp16 <-> fp32 conversion.
llvm-svn: 98888
2010-03-18 22:35:37 +00:00
Dan Gohman
ff37afdc4b Define placement new wrappers for BumpPtrAllocator and
RecyclingAllocator to allow client code to be simpler, and
simplify several clients.

llvm-svn: 98847
2010-03-18 18:49:47 +00:00
Bob Wilson
a8b566d854 Fix pr6543: svn r88806 changed MachineJumpTableInfo::getJumpTableIndex() to
always create a new jump table.  The intention was to avoid merging jump
tables in SelectionDAGBuilder, and to wait for the branch folding pass to
merge tables.  Unfortunately, the same getJumpTableIndex() method is also
used to merge tables in branch folding, so as a result of this change
branch tables are never merged.  Worse, the branch folding code is expecting
getJumpTableIndex to always return the index of an existing table, but with
this change, it never does so.  In at least some cases, e.g., pr6543, this
creates references to non-existent tables.

I've fixed the problem by adding a new createJumpTableIndex function, which
will always create a new table, and I've changed getJumpTableIndex to only
look at existing tables.

llvm-svn: 98845
2010-03-18 18:42:41 +00:00
Devang Patel
dd5c1fcba9 Fix comment.
llvm-svn: 98830
2010-03-18 16:41:16 +00:00
Devang Patel
9ad039e65f Debug info intrinsic does not intefer during tail call optimization.
llvm-svn: 98778
2010-03-17 23:52:37 +00:00
Chris Lattner
cf7f134913 reapply r98656 unmodified, which exposed the asmprinter not
handling constant unions.

llvm-svn: 98680
2010-03-16 21:25:55 +00:00
Daniel Dunbar
faade5305c Revert r98656, its breaking all over the place.
llvm-svn: 98662
2010-03-16 19:35:34 +00:00
Chris Lattner
7a96045d0a improve support for uniontype and ConstantUnion, patch by Tim Northover!
llvm-svn: 98656
2010-03-16 19:15:03 +00:00
Devang Patel
db8c479e0d Create SDDbgValue for dbg_value intrinsics and remember its connections with DAG nodes.
This is a work in progress. Patch by Dale Johannesen!

llvm-svn: 98568
2010-03-15 19:15:44 +00:00
Devang Patel
3244526a3b Emit dwarf variable info communicated by code generator through DBG_VALUE machine instructions.
This is a work in progress.

llvm-svn: 98556
2010-03-15 18:33:46 +00:00
Chris Lattner
a8e4282df3 SIGN_EXTEND from the same type as the dest is valid.
llvm-svn: 98548
2010-03-15 16:15:56 +00:00
Chris Lattner
89c2d22d3d sink the call to VT.getSizeInBits() down into its uses,
not all unary nodes necessarily have a simple result type.

llvm-svn: 98547
2010-03-15 16:05:15 +00:00
Duncan Sands
217cec1786 Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodes
with ppc_f128 type by having the type legalizer turn these back into a
call to copysignl.

llvm-svn: 98514
2010-03-14 21:08:40 +00:00
Evan Cheng
f91618ae9f Rename SDDbgValue.h to SDNodeDbgValue.h for consistency.
llvm-svn: 98513
2010-03-14 19:56:39 +00:00
Chris Lattner
70eca8f78e fix ShrinkDemandedOps to not leave dead nodes around,
fixing PR6607

llvm-svn: 98512
2010-03-14 19:46:02 +00:00