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

558 Commits

Author SHA1 Message Date
Dale Johannesen
1580ab6b7f Remove more non-DebugLoc getNode variants. Use
getCALLSEQ_{END,START} to permit passing no DebugLoc
there.  UNDEF doesn't logically have DebugLoc; add
getUNDEF to encapsulate this.

llvm-svn: 63978
2009-02-06 23:05:02 +00:00
Dale Johannesen
c405486235 Remove more non-DebugLoc versions of getNode.
llvm-svn: 63969
2009-02-06 21:50:26 +00:00
Dale Johannesen
84498c427e Propagation in TargetLowering. Includes passing a DL
into SimplifySetCC which gets called elsewhere.

llvm-svn: 63583
2009-02-03 00:47:48 +00:00
Duncan Sands
cac6cf74f9 Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.

llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling
518ecfa97c Forgot some more DebugLoc propagations.
llvm-svn: 63493
2009-02-01 11:19:36 +00:00
Duncan Sands
74179a9dde Fix PR3401: when using large integers, the type
returned by getShiftAmountTy may be too small
to hold shift values (it is an i8 on x86-32).
Before and during type legalization, use a large
but legal type for shift amounts: getPointerTy;
afterwards use getShiftAmountTy, fixing up any
shift amounts with a big type during operation
legalization.  Thanks to Dan for writing the
original patch (which I shamelessly pillaged).

llvm-svn: 63482
2009-01-31 15:50:11 +00:00
Bill Wendling
679d743429 Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Bill Wendling
33e437d960 More DebugLoc propagation.
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Bill Wendling
191c1bcb0c More DebugLoc propagation.
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling
061530382c More DebugLoc propagation in LOAD etc. methods.
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Bill Wendling
8038d99071 More DebugLoc propagation in floating-point methods.
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Bill Wendling
cebc5ac36d Standardize comments about folding xforms.
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling
67737da99b Get rid of the non-DebugLoc-ified getNOT() method.
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling
b3ece8cc6f Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling
00f0882476 Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling
bfa7cfd7c7 Propagate debug loc info for BIT_CONVERT.
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Bill Wendling
c05f48a66d Propagate debug loc info for more *_EXTEND methods.
llvm-svn: 63437
2009-01-30 22:33:24 +00:00
Bill Wendling
ca9c42acf5 Propagate debug loc info for ANY_EXTEND.
llvm-svn: 63436
2009-01-30 22:27:33 +00:00
Bill Wendling
5c326f6512 Propagate debug loc info for some of the *_EXTEND functions.
llvm-svn: 63434
2009-01-30 22:23:15 +00:00
Bill Wendling
de0da1da41 - Propagate debug loc info for SELECT.
- Added xform for (select X, 1, Y) and (select X, Y, 0), which was commented on,
  but missing.

llvm-svn: 63428
2009-01-30 22:02:18 +00:00
Bill Wendling
18aa03303b Propagate debug loc info for Shifts.
llvm-svn: 63424
2009-01-30 21:37:17 +00:00
Bill Wendling
8f8bb57472 Propagate debug loc info for XOR and MatchRotate.
llvm-svn: 63420
2009-01-30 21:14:50 +00:00
Bill Wendling
d62cec3ba3 Propagate debug loc info for OR. Also clean up some comments.
llvm-svn: 63419
2009-01-30 20:59:34 +00:00
Bill Wendling
e74546802d Perform obvious constant arithmetic folding.
llvm-svn: 63417
2009-01-30 20:50:00 +00:00
Bill Wendling
4f61644d4c Propagate debug loc info for AND. Also clean up some comments.
llvm-svn: 63416
2009-01-30 20:43:18 +00:00
Bill Wendling
79d8e31a5a Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.
llvm-svn: 63411
2009-01-30 19:25:47 +00:00
Bill Wendling
4d923185fc Propagate debug loc info in SimplifyNodeWithTwoResults.
llvm-svn: 63376
2009-01-30 03:08:40 +00:00
Bill Wendling
7067a571ce Propagate debug loc info for MULHS.
llvm-svn: 63375
2009-01-30 03:00:18 +00:00
Bill Wendling
031d7dcfe2 Propagate debug loc info for SREM and UREM.
llvm-svn: 63374
2009-01-30 02:57:00 +00:00
Bill Wendling
f4506379ae Propagate debug loc info for UDIV.
llvm-svn: 63373
2009-01-30 02:55:25 +00:00
Bill Wendling
532bb33a10 Propagate debug loc info for SDIV.
llvm-svn: 63372
2009-01-30 02:52:17 +00:00
Bill Wendling
577589aa4a Forgot to propagate debug loc info here.
llvm-svn: 63371
2009-01-30 02:49:26 +00:00
Bill Wendling
ff10c16660 Propagate debug loc info for MUL.
llvm-svn: 63369
2009-01-30 02:45:56 +00:00
Bill Wendling
a7791b0e4e Propagate debug loc info in SUB.
llvm-svn: 63368
2009-01-30 02:42:10 +00:00
Bill Wendling
665afce822 Propagate debug loc info in ADDC and ADDE.
llvm-svn: 63367
2009-01-30 02:38:00 +00:00
Bill Wendling
1ad9d3d9d1 Propagate debug loc info in DAG combine's "ADD".
llvm-svn: 63366
2009-01-30 02:31:17 +00:00
Bill Wendling
030f0fced8 - Propagate debug loc info in combineSelectAndUse().
- Modify ReassociateOps so that the resulting SDValue is what the comment claims
  it is.

llvm-svn: 63365
2009-01-30 02:23:43 +00:00
Bill Wendling
31986c393f Propagate debug location info for the token factor.
llvm-svn: 63355
2009-01-30 01:13:16 +00:00
Bill Wendling
8165903969 Add DebugLoc propagation to some of the methods in DAG combiner.
llvm-svn: 63350
2009-01-30 00:45:56 +00:00
Dan Gohman
9d120d6d8f Make x86's BT instruction matching more thorough, and add some
dagcombines that help it match in several more cases. Add
several more cases to test/CodeGen/X86/bt.ll. This doesn't
yet include matching for BT with an immediate operand, it
just covers more register+register cases.

llvm-svn: 63266
2009-01-29 01:59:02 +00:00
Dan Gohman
bc43253a91 Make isOperationLegal do what its name suggests, and introduce a
new isOperationLegalOrCustom, which does what isOperationLegal
previously did.

Update a bunch of callers to use isOperationLegalOrCustom
instead of isOperationLegal. In some case it wasn't obvious
which behavior is desired; when in doubt I changed then to
isOperationLegalOrCustom as that preserves their previous
behavior.

This is for the second half of PR3376.

llvm-svn: 63212
2009-01-28 17:46:25 +00:00
Dan Gohman
0400e83ed8 Add an assertion to the form of SelectionDAG::getConstant that takes
a uint64_t to verify that the value is in range for the given type,
to help catch accidental overflow. Fix a few places that relied on
getConstant implicitly truncating the value.

llvm-svn: 63128
2009-01-27 20:39:34 +00:00
Dan Gohman
4abaebae0c Take the next steps in making SDUse more consistent with LLVM Use, and
tidy up SDUse and related code.
 - Replace the operator= member functions with a set method, like
   LLVM Use has, and variants setInitial and setNode, which take
   care up updating use lists, like LLVM Use's does. This simplifies
   code that calls these functions.
 - getSDValue() is renamed to get(), as in LLVM Use, though most
   places can either use the implicit conversion to SDValue or the
   convenience functions instead.
 - Fix some more node vs. value terminology issues.

Also, eliminate the one remaining use of SDOperandPtr, and
SDOperandPtr itself.

llvm-svn: 62995
2009-01-26 04:35:06 +00:00
Dan Gohman
c971f3cf5b Fold x-0 to x in unsafe-fp-math mode. This comes up in the
testcase from PR3376, and in fact is sufficient to completely
avoid the problem in that testcase.

There's an underlying problem though; TLI.isOperationLegal
considers Custom to be Legal, which might be ok in some
cases, but that's what DAGCombiner is using in many places
to test if something is legal when LegalOperations is true.
When DAGCombiner is running after legalize, this isn't
sufficient. I'll address this in a separate commit.

llvm-svn: 62860
2009-01-23 19:10:37 +00:00
Bob Wilson
d79e684d1e Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"
to "C ^ 1" is only valid when C is known to be either 0 or 1.  Most of the
similar foldings in this function only handle "i1" types, but this one appears
intentionally written to handle larger integer types.  If C has an integer
type larger than "i1", this needs to check if the high bits of a boolean
are known to be zero.  I also changed the comment to describe this folding as
"C ^ 1" instead of "~C", since that is what the code does and since the latter
would only be valid for "i1" types.  The good news is that most LLVM targets
use TargetLowering::ZeroOrOneBooleanContent so this change will not disable
the optimization; the bad news is that I've been unable to come up with a
testcase to demonstrate the problem.

I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X",
since the code looks correct to me.  It could be made more aggressive by not
limiting the type to "i1", but that would then require checking for
TargetLowering::ZeroOrNegativeOneBooleanContent.  Similar changes could be
done for the other SELECT foldings, but it was decided to be not worth the
trouble and complexity (see e.g., r44663).

llvm-svn: 62790
2009-01-22 22:05:48 +00:00
Dan Gohman
a6e5948fce Don't create ISD::FNEG nodes after legalize if they aren't legal.
Simplify x+0 to x in unsafe-fp-math mode. This avoids a bunch of
redundant work in many cases, because in unsafe-fp-math mode,
ISD::FADD with a constant is considered free to negate, so the
DAGCombiner often negates x+0 to -0-x thinking it's free, when
in reality the end result is -x, which is more expensive than x.

Also, combine x*0 to 0.

This fixes PR3374.

llvm-svn: 62789
2009-01-22 21:58:43 +00:00
Bob Wilson
186046e657 Add SelectionDAG::getNOT method to construct bitwise NOT operations,
corresponding to the "not" and "vnot" PatFrags.  Use the new method
in some places where it seems appropriate.

llvm-svn: 62768
2009-01-22 17:39:32 +00:00
Dan Gohman
d021a20409 Simplify ReduceLoadWidth's logic: it doesn't need several different
special cases after producing the new reduced-width load, because the
new load already has the needed adjustments built into it. This fixes
several bugs due to the special cases, including PR3317.

llvm-svn: 62692
2009-01-21 15:17:51 +00:00
Dan Gohman
ff4c4ab39f Fix a dagcombine to not generate loads of non-round integer types,
as its comment says, even in the case where it will be generating
extending loads. This fixes PR3216.

llvm-svn: 62557
2009-01-20 01:06:45 +00:00
Dan Gohman
af4e583c93 Fix SelectionDAG::ReplaceAllUsesWith to behave correctly when
uses are added to the From node while it is processing From's
use list, because of automatic local CSE. The fix is to avoid
visiting any new uses.

Fix a few places in the DAGCombiner that assumed that after
a RAUW call, the From node has no users and may be deleted.

This fixes PR3018.

llvm-svn: 62533
2009-01-19 21:44:21 +00:00