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

3947 Commits

Author SHA1 Message Date
David Greene
fde2825063 Add some new debugging APIs to print out "raw" SelectionDAGs to make
understanding CannotYTetSelect and other errors easier.

llvm-svn: 93901
2010-01-19 20:37:34 +00:00
Dale Johannesen
e1ba7ecf45 Revert 93811 per request.
llvm-svn: 93818
2010-01-19 00:10:52 +00:00
Dale Johannesen
0b8b2713d3 Enable code to emit dbg.declare as DEBUG_VALUE
comments (fast isel, X86).  This doesn't seem
to break any functionality, but will introduce
cases where -g affects the generated code.  I'll
be fixing that.

llvm-svn: 93811
2010-01-18 23:34:55 +00:00
Evan Cheng
5cf9d23e4e Canonicalize -1 - x to ~x.
Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
  %t1 = sub i32 0, %a
  %t2 = add i32 %t1, -1
The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
will fold it to -1 - %a.

llvm-svn: 93773
2010-01-18 21:38:44 +00:00
Kenneth Uildriks
d6b30baf78 When checking for sret-demotion, it needs to use legal types. When using the return value of an sret-demoted call, it needs to use possibly illegal types that match the declared Type of the callee.
llvm-svn: 93667
2010-01-16 23:37:33 +00:00
David Greene
d8faccbeab Add some debug routines to SelectionDAG to dump full DAGs.
print/dumpWithDepth allows one to dump a DAG up to N levels deep.
dump/printWithFullDepth prints the whole DAG, subject to a depth limit
on 100 in the default case (to prevent infinite recursion).

Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly
what the non-matching DAG looks like.

llvm-svn: 93538
2010-01-15 19:43:23 +00:00
Victor Hernandez
c1b5223e76 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.

llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Victor Hernandez
97d7107d5e Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Victor Hernandez
aee71b4e81 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Jim Grosbach
7239c4c92e fix 80-column violations
llvm-svn: 93487
2010-01-15 00:36:15 +00:00
Dan Gohman
7c596d2b00 Fix a codegen abort seen in 483.xalancbmk.
llvm-svn: 93417
2010-01-14 03:08:49 +00:00
Dan Gohman
2cd1b789c7 Update a partially obsolete comment.
llvm-svn: 93228
2010-01-12 04:32:35 +00:00
Dan Gohman
da0bcb49b5 Fix a typo in a comment.
llvm-svn: 93227
2010-01-12 04:30:26 +00:00
Jakob Stoklund Olesen
f1c71ef6ba Avoid adding PHI arguments for a predecessor that has gone away when a BRCOND was constant folded.
This fixes PR5980.

llvm-svn: 93184
2010-01-11 21:02:33 +00:00
Mon P Wang
e8470bbcc4 Disable transformation of select of two loads to a select of address and then a load if the
loads are not in the default address space because the transformation discards src value info.

llvm-svn: 93180
2010-01-11 20:12:49 +00:00
Dan Gohman
3708af1c59 Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNode
really does need to be a vector type, because
TargetLowering::getOperationAction for SIGN_EXTEND_INREG uses that type,
and it needs to be able to distinguish between vectors and scalars.

Also, fix some more issues with legalization of vector casts.

llvm-svn: 93043
2010-01-09 02:13:55 +00:00
Evan Cheng
afa00d14db Dan pointed out checking whether a node is dead by comparing its opcode to ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead.
llvm-svn: 93031
2010-01-09 00:21:08 +00:00
Evan Cheng
f96a9ec02b ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again.
llvm-svn: 92988
2010-01-08 02:36:12 +00:00
Chris Lattner
e0199dff81 Fix rdar://7517201, a regression introduced by r92849.
When folding a and(any_ext(load)) both the any_ext and the
load have to have only a single use.

This removes the anyext-uses.ll testcase which started failing
because it is unreduced and unclear what it is testing.

llvm-svn: 92950
2010-01-07 21:59:23 +00:00
Chris Lattner
f68e328a99 factor this code better and reduce nesting at the same
time, no functionality change.

llvm-svn: 92948
2010-01-07 21:53:27 +00:00
Evan Cheng
4523041394 APInt'fy TargetLowering::SimplifySetCC to fix PR5963.
llvm-svn: 92943
2010-01-07 20:58:44 +00:00
Benjamin Kramer
22ec2524fd Use pop_back_val instead of back()+pop_back.
llvm-svn: 92918
2010-01-07 17:27:56 +00:00
Evan Cheng
f9dade0634 Comment.
llvm-svn: 92850
2010-01-06 19:43:21 +00:00
Evan Cheng
25dcf9b830 Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.

llvm-svn: 92849
2010-01-06 19:38:29 +00:00
Bill Wendling
b4f0d6e3b6 The previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order.
llvm-svn: 92810
2010-01-06 00:23:35 +00:00
Bill Wendling
41e18c3512 Only check the ordering if there is an ordering for each nodes.
llvm-svn: 92807
2010-01-06 00:09:23 +00:00
Bill Wendling
b7d6746476 Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.

llvm-svn: 92806
2010-01-05 23:48:12 +00:00
Bill Wendling
7e9607ab56 Don't assign the shift the same type as the variable being shifted. This could
result in illegal types for the SHL operator.

llvm-svn: 92797
2010-01-05 22:39:10 +00:00
Dan Gohman
9ef9e2c758 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.

llvm-svn: 92794
2010-01-05 22:26:32 +00:00
Benjamin Kramer
e90a3c66c4 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Devang Patel
9c02d20409 Delete renaming use of dead dbg intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start
 Intrinsic::dbg_region_end
 Intrinsic::dbg_func_start

llvm-svn: 92672
2010-01-05 01:47:06 +00:00
David Greene
e5bee4794b Change errs() to dbgs().
llvm-svn: 92597
2010-01-05 01:26:11 +00:00
David Greene
b1764ac8cb Change errs() to dbgs().
llvm-svn: 92581
2010-01-05 01:25:11 +00:00
David Greene
54706ebebb Change errs() to dbgs().
llvm-svn: 92580
2010-01-05 01:25:09 +00:00
David Greene
4f5be2f621 Change errs() to dbgs().
llvm-svn: 92579
2010-01-05 01:25:04 +00:00
David Greene
bf6025f893 Change errs() to dbgs().
llvm-svn: 92578
2010-01-05 01:25:00 +00:00
David Greene
2c9dbf7b18 Change errs() to dbgs().
llvm-svn: 92577
2010-01-05 01:24:57 +00:00
David Greene
3a4b23b913 Change errs() to dbgs().
llvm-svn: 92576
2010-01-05 01:24:54 +00:00
David Greene
a9fbae472c Change errs() to dbgs().
llvm-svn: 92575
2010-01-05 01:24:53 +00:00
David Greene
5201625e9c Change errs() to dbgs().
llvm-svn: 92574
2010-01-05 01:24:50 +00:00
David Greene
aaf3acc471 Change errs() to dbgs().
llvm-svn: 92573
2010-01-05 01:24:48 +00:00
David Greene
4c9eb54e83 Change errs() to dbgs().
llvm-svn: 92572
2010-01-05 01:24:45 +00:00
David Greene
216139c074 Change errs() to dbgs().
llvm-svn: 92571
2010-01-05 01:24:43 +00:00
David Greene
82adcc9c8f Change errs() to dbgs().
llvm-svn: 92570
2010-01-05 01:24:40 +00:00
David Greene
616c94ab91 Change errs() to dbgs().
llvm-svn: 92569
2010-01-05 01:24:36 +00:00
David Greene
b22b413dff Change errs() to dbgs().
llvm-svn: 92568
2010-01-05 01:24:34 +00:00
Dan Gohman
9bcfdf98f1 Change SelectCode's argument from SDValue to SDNode *, to make it more
clear what information these functions are actually using.

This is also a micro-optimization, as passing a SDNode * around is
simpler than passing a { SDNode *, int } by value or reference.

llvm-svn: 92564
2010-01-05 01:24:18 +00:00
Dan Gohman
2754bdcfdb Use a pointer type rather than MVT::Other for the ExternalSymbol node used
in an inline asm.

llvm-svn: 92512
2010-01-04 21:00:54 +00:00
Chris Lattner
fe8af82cd4 Teach codegen to handle:
(X != null) | (Y != null) --> (X|Y) != 0
 (X == null) & (Y == null) --> (X|Y) == 0

so that instcombine can stop doing this for pointers.  This is part of PR3351,
which is a case where instcombine doing this for pointers (inserting ptrtoint)
is pessimizing code.

llvm-svn: 92406
2010-01-02 00:00:03 +00:00
Chris Lattner
330323f780 whitespace cleanup
llvm-svn: 92404
2010-01-01 23:37:34 +00:00