1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

1624 Commits

Author SHA1 Message Date
Reid Spencer
1fd12cf9f6 For PR1205:
APIntify several utility functions supporting logical operators and shift
operators.

Patch by Zhou Sheng.

llvm-svn: 35281
2007-03-23 18:46:34 +00:00
Zhou Sheng
e706d8f56d Make the "KnownZero ^ TypeMask" computation just once.
llvm-svn: 35276
2007-03-23 03:13:21 +00:00
Zhou Sheng
6b7b4945f1 Simplify the code.
llvm-svn: 35275
2007-03-23 02:39:25 +00:00
Reid Spencer
9881580cec For PR1205:
APInt support for logical operators in visitAnd, visitOr, and visitXor.

Patch by Zhou Sheng.

llvm-svn: 35273
2007-03-22 22:19:58 +00:00
Reid Spencer
74288268d3 For PR1205:
* APIntify commonIntCastTransforms
* APIntify visitTrunc
* APIntify visitZExt

Patch by Zhou Sheng.

llvm-svn: 35271
2007-03-22 20:56:53 +00:00
Reid Spencer
b6c09a009e For PR1205:
* Re-enable the APInt version of MaskedValueIsZero.
* APIntify the Comput{Un}SignedMinMaxValuesFromKnownBits functions
* APIntify visitICmpInst.

llvm-svn: 35270
2007-03-22 20:36:03 +00:00
Dan Gohman
d0a0ea9916 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Nick Lewycky
428523f51a Fix broken optimization disabled by a logic bug.
Analyze GEPs. If the indices are all zero, transfer whether the pointer is
known to be not null through the GEP.

Add a few more cases for xor and shift instructions.

llvm-svn: 35257
2007-03-22 02:02:51 +00:00
Reid Spencer
bdfbda05fb For PR1248:
* Fix some indentation and comments in InsertRangeTest
* Add an "IsSigned" parameter to AddWithOverflow and make it handle signed
  additions. Also, APIntify this function so it works with any bitwidth.
* For the icmp pred ([us]div %X, C1), C2 transforms, exit early if the
  div instruction's RHS is zero.
* Finally, for icmp pred (sdiv %X, C1), -C2, fix an off-by-one error. The
  HiBound needs to be incremented in order to get the range test correct.

llvm-svn: 35247
2007-03-21 23:19:50 +00:00
Dale Johannesen
3e422e3b49 do not share old induction variables when this would result in invalid
instructions (that would have to be split later)

llvm-svn: 35227
2007-03-20 21:54:54 +00:00
Jeff Cohen
8dea6ada6f Fix some VC++ warnings.
llvm-svn: 35224
2007-03-20 20:43:18 +00:00
Zhou Sheng
0ae1c9e1ad Simplify isHighOnes().
llvm-svn: 35211
2007-03-20 12:49:06 +00:00
Dale Johannesen
516d98c710 use types of loads and stores, not address, in CheckForIVReuse
llvm-svn: 35197
2007-03-20 00:47:50 +00:00
Reid Spencer
2f1ee85f90 Make isOneBitSet faster by using APInt::isPowerOf2. Thanks Chris.
llvm-svn: 35194
2007-03-20 00:16:52 +00:00
Reid Spencer
a792b71ab3 APIntify the isHighOnes utility function.
llvm-svn: 35190
2007-03-19 21:29:50 +00:00
Reid Spencer
4009f1eacb Implement isMaxValueMinusOne in terms of APInt instead of uint64_t.
Patch by Sheng Zhou.

llvm-svn: 35188
2007-03-19 21:10:28 +00:00
Reid Spencer
57a15f4445 Implement isMinValuePlusOne using facilities of APInt instead of uint64_t
Patch by Zhou Sheng.

llvm-svn: 35187
2007-03-19 21:08:07 +00:00
Reid Spencer
1985e3645b Implement isOneBitSet in terms of APInt::countPopulation.
llvm-svn: 35186
2007-03-19 21:04:43 +00:00
Reid Spencer
367a2917c0 1. Use APInt::getSignBit to reduce clutter (patch by Sheng Zhou)
2. Replace uses of the "isPositive" utility function with APInt::isPositive

llvm-svn: 35185
2007-03-19 20:58:18 +00:00
Reid Spencer
49ea42b719 Remove a redundant clause in an if statement.
Patch by Sheng Zhou.

llvm-svn: 35184
2007-03-19 20:47:50 +00:00
Chris Lattner
5f1d3ac7e4 fix ScalarRepl/2007-03-19-CanonicalizeMemcpy.ll
llvm-svn: 35169
2007-03-19 18:25:57 +00:00
Chris Lattner
5e2e3ddb7e implement the next chunk of SROA with memset/memcpy's of aggregates. This
implements Transforms/ScalarRepl/memset-aggregate-byte-leader.ll

llvm-svn: 35150
2007-03-19 00:16:43 +00:00
Nick Lewycky
2a51ea0c0e Clean up this code and fix subtract miscompile.
llvm-svn: 35146
2007-03-18 22:58:46 +00:00
Chris Lattner
adf7003452 Implement InstCombine/and-xor-merge.ll:test[12].
Rearrange some code to simplify it now that shifts are binops

llvm-svn: 35145
2007-03-18 22:51:34 +00:00
Nick Lewycky
41f13d431a Propagate ValueRanges across equality.
Add some more micro-optimizations: x * 0 = 0, a - x = a --> x = 0.

llvm-svn: 35138
2007-03-18 01:09:32 +00:00
Anton Korobeynikov
b34e09291b Silence warning
llvm-svn: 35137
2007-03-17 14:48:06 +00:00
Nick Lewycky
de44438e24 Add more comments and update to new asm syntax.
Add new micro-optimizations.

Add icmp predicate snuggling. Given %x ULT 4, "icmp ugt %x, 2" becomes
"icmp eq %x, 3". This doesn't apply in any non-trivial cases yet due to missing
support for NE values in ValueRanges.

llvm-svn: 35119
2007-03-16 02:37:39 +00:00
Zhou Sheng
5c6399dab7 ShiftAmt might equal to zero. Handle this situation.
llvm-svn: 35094
2007-03-14 09:07:33 +00:00
Zhou Sheng
4415c2647e Enable KnownZero/One.clear().
llvm-svn: 35093
2007-03-14 03:21:24 +00:00
Evan Cheng
bd964bd8eb Correct type info for isLegalAddressImmediate() check.
llvm-svn: 35086
2007-03-13 20:34:37 +00:00
Chris Lattner
efc2339bd7 ifdef out some dead code.
Fix PR1244 and Transforms/InstCombine/2007-03-13-CompareMerge.ll

llvm-svn: 35082
2007-03-13 14:27:42 +00:00
Zhou Sheng
7cf2811ab3 For expression like
"APInt::getAllOnesValue(ShiftAmt).zextOrCopy(BitWidth)",
to handle ShiftAmt == BitWidth situation, use zextOrCopy() instead of
zext().

llvm-svn: 35080
2007-03-13 06:40:59 +00:00
Zhou Sheng
14cef9ec74 In APInt version ComputeMaskedBits():
1. Ensure VTy, KnownOne and KnownZero have same bitwidth.
  2. Make code more efficient.

llvm-svn: 35078
2007-03-13 02:23:10 +00:00
Evan Cheng
1fcdd7e1e5 Use new TargetLowering addressing modes hooks.
llvm-svn: 35072
2007-03-12 23:27:37 +00:00
Reid Spencer
d59425085f Add an APInt version of SimplifyDemandedBits.
Patch by Zhou Sheng.

llvm-svn: 35064
2007-03-12 17:25:59 +00:00
Reid Spencer
b18f916bbe Add an APInt version of ShrinkDemandedConstant.
Patch by Zhou Sheng.

llvm-svn: 35063
2007-03-12 17:15:10 +00:00
Zhou Sheng
c8583ff888 Avoid to assert on "(KnownZero & KnownOne) == 0".
llvm-svn: 35062
2007-03-12 16:54:56 +00:00
Zhou Sheng
c9c53385b8 In function ComputeMaskedBits():
1. Replace getSignedMinValue() with getSignBit() for better code readability.
  2. Replace APIntOps::shl() with operator<<= for convenience.
  3. Make APInt construction more effective.

llvm-svn: 35060
2007-03-12 05:44:52 +00:00
Nick Lewycky
8a08bcfbe7 Add value ranges. Currently inefficient in both execution time and
optimization power.

llvm-svn: 35058
2007-03-10 18:12:48 +00:00
Devang Patel
ca60446cb4 Increment iterator now because IVUseShouldUsePostIncValue may remove
User from the list of I users.

llvm-svn: 35051
2007-03-09 21:19:53 +00:00
Zhou Sheng
acc59870f7 Fix a bug in function ComputeMaskedBits().
llvm-svn: 35027
2007-03-08 15:15:18 +00:00
Chris Lattner
66843dbef9 This appears correct, enable it so we can see perf changes on testers
llvm-svn: 35024
2007-03-08 07:03:55 +00:00
Chris Lattner
049f21257d Second half of PR1226. This is currently still disabled, until I have a chance to
do the correctness/performance analysis testing.

llvm-svn: 35023
2007-03-08 06:36:54 +00:00
Zhou Sheng
37cb2e2d53 Fix a bug in APIntified ComputeMaskedBits().
llvm-svn: 35022
2007-03-08 05:42:00 +00:00
Reid Spencer
c3f0724204 For PR1205:
Provide an APIntified version of MaskedValueIsZero. This will (temporarily)
cause a "defined but not used" message from the compiler. It will be used
in the next patch in this series.

Patch by Sheng Zhou.

llvm-svn: 35019
2007-03-08 01:52:58 +00:00
Reid Spencer
6a924d1a1d For PR1205:
Add a new ComputeMaskedBits function that is APIntified. We'll slowly
convert things over to use this version. When its all done, we'll remove
the existing version.

llvm-svn: 35018
2007-03-08 01:46:38 +00:00
Devang Patel
6a56e3c1a0 Now IndVarSimplify is a LoopPass.
llvm-svn: 35003
2007-03-07 06:39:01 +00:00
Devang Patel
16107bb71b Now LICM is a LoopPass.
llvm-svn: 35001
2007-03-07 04:41:30 +00:00
Devang Patel
3a24891f80 Now LoopUnroll is a LoopPass.
llvm-svn: 34996
2007-03-07 01:38:05 +00:00
Devang Patel
c35610b9f9 Now LoopUnswitch is a LoopPass.
llvm-svn: 34992
2007-03-07 00:26:10 +00:00