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

30900 Commits

Author SHA1 Message Date
Dale Johannesen
43fc14d6e4 Look through bitcast when finding IVs. (Chris' patch really.)
llvm-svn: 35347
2007-03-26 03:01:27 +00:00
Chris Lattner
cc91b2a91d Start value symbol tables out small (space for 16 elts), not huge (space for 512).
This is particularly useful for the JIT, which lazily deserializes functions.

llvm-svn: 35346
2007-03-26 01:45:35 +00:00
Anton Korobeynikov
e1787d5f46 Add "feature" testcase for new switch lowering code
llvm-svn: 35345
2007-03-25 22:01:14 +00:00
Reid Spencer
4984ab6c01 Compute getLowBitsSet correctly. Using the complement of a 64-bit value
and shifting down without regard for the bitwidth of the APInt can lead
to incorrect initialization values. Instead, check for the word size case
(to avoid undef results from shift) and then do (1 << loBitsSet) - 1

llvm-svn: 35344
2007-03-25 21:58:42 +00:00
Reid Spencer
c48255bfcf Add a test case for PR1271 (necessary, but not sufficient).
llvm-svn: 35343
2007-03-25 21:30:41 +00:00
Reid Spencer
4d3d7d0f2a For PR1271:
Remove a use of getLowBitsSet that caused the mask used for replacement of
shl/lshr pairs with an AND instruction to be computed incorrectly. Its not
clear exactly why this is the case. This solves the disappearing shifts
problem, but it doesn't fix Regression/C/2003-05-21-UnionBitFields. It
seems there is more going on.

llvm-svn: 35342
2007-03-25 21:11:44 +00:00
Chris Lattner
26cfd91db8 implement Transforms/InstCombine/cast2.ll:test3 and PR1263
llvm-svn: 35341
2007-03-25 20:43:09 +00:00
Chris Lattner
c5657ac790 new testcase
llvm-svn: 35340
2007-03-25 20:42:40 +00:00
Reid Spencer
1677543a3a Some cleanup from review:
* Don't assume shift amounts are <= 64 bits
* Avoid creating an extra APInt in SubOne and AddOne by using -- and ++
* Add another use of getLowBitsSet
* Convert a series of if statements to a switch

llvm-svn: 35339
2007-03-25 19:55:33 +00:00
Anton Korobeynikov
6f78c59650 First step of switch lowering refactoring: perform worklist-driven
strategy, emit JT's where possible.

llvm-svn: 35338
2007-03-25 15:07:15 +00:00
Anton Korobeynikov
a5e854461f Fix authorship
llvm-svn: 35337
2007-03-25 13:44:26 +00:00
Chris Lattner
f4ff1dc689 fold constantexprs more aggressively, fixing PR1265
llvm-svn: 35336
2007-03-25 05:47:04 +00:00
Reid Spencer
8449e5fa0e Refactor several ConstantExpr::getXXX calls with ConstantInt arguments
using the facilities of APInt. While this duplicates a tiny fraction of
the constant folding code, it also makes the code easier to read and
avoids large ConstantExpr overhead for simple, known computations.

llvm-svn: 35335
2007-03-25 05:33:51 +00:00
Chris Lattner
ee90a087a6 add a note
llvm-svn: 35334
2007-03-25 05:10:46 +00:00
Zhou Sheng
3312a86598 1. Avoid unnecessary APInt construction if possible.
2. Use isStrictlyPositive() instead of isPositive() in two places where
   they need APInt value > 0 not only >=0.

llvm-svn: 35333
2007-03-25 05:01:29 +00:00
Chris Lattner
6f17a615cb Implement support for vector operands to inline asm, implementing
CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll

llvm-svn: 35332
2007-03-25 05:00:54 +00:00
Chris Lattner
99ba969ae3 new testcase
llvm-svn: 35331
2007-03-25 05:00:23 +00:00
Chris Lattner
6d8bbccee0 add a note
llvm-svn: 35330
2007-03-25 04:46:28 +00:00
Chris Lattner
31c6763051 Fix CodeGen/PowerPC/2007-03-24-cntlzd.ll
llvm-svn: 35329
2007-03-25 04:44:03 +00:00
Chris Lattner
a01030bcf4 test that the ppc backend can do 64-bit cntlz
llvm-svn: 35328
2007-03-25 04:43:51 +00:00
Chris Lattner
4a7feb72f5 implement initial support for the silly X constraint. Testcase here: CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll
llvm-svn: 35327
2007-03-25 04:35:41 +00:00
Chris Lattner
60fa65770f new testcase
llvm-svn: 35326
2007-03-25 04:35:23 +00:00
Reid Spencer
e601991a5e Make more uses of getHighBitsSet and get rid of some pointless & of an
APInt with its type mask.

llvm-svn: 35325
2007-03-25 04:26:16 +00:00
Chris Lattner
91adfbe0ff Implement CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
llvm-svn: 35324
2007-03-25 02:18:14 +00:00
Chris Lattner
6aa707f1b2 new testcase
llvm-svn: 35323
2007-03-25 02:17:58 +00:00
Chris Lattner
b19069959d switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.

llvm-svn: 35322
2007-03-25 02:14:49 +00:00
Reid Spencer
676eeb9c94 More APIntification:
* Convert the last use of a uint64_t that should have been an APInt.
* Change ComputeMaskedBits to have a const reference argument for the Mask
  so that recursions don't cause unneeded temporaries. This causes temps
  to be needed in other places (where the mask has to change) but this
  change optimizes for the recursion which is more frequent.
* Remove two instances of &ing a Mask with getAllOnesValue. Its not
  needed any more because APInt is accurate in its bit computations.
* Start using the getLowBitsSet and getHighBits set methods on APInt
  instead of shifting. This makes it more clear in the code what is
  going on.

llvm-svn: 35321
2007-03-25 02:03:12 +00:00
Chris Lattner
18c3c6a01d Allow the b/h/w/k constraints to be applied to values that have multiple alternatives, and end up not being registers.
llvm-svn: 35320
2007-03-25 02:01:03 +00:00
Chris Lattner
104e73382c enforce the proper range for the i386 N constraint.
llvm-svn: 35319
2007-03-25 01:57:35 +00:00
Chris Lattner
92e2ee7b2d Fix test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
llvm-svn: 35318
2007-03-25 01:44:57 +00:00
Chris Lattner
62598bf96c new testcase
llvm-svn: 35317
2007-03-25 01:44:40 +00:00
Reid Spencer
b5b291924a Fix a typo in a comment.
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer
16d08887ef Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.

llvm-svn: 35315
2007-03-25 00:01:47 +00:00
Chris Lattner
3f71a6b498 fix a regression on vector or instructions.
llvm-svn: 35314
2007-03-24 23:56:43 +00:00
Reid Spencer
d24dc1f9a6 Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.

llvm-svn: 35313
2007-03-24 23:47:58 +00:00
Reid Spencer
fb188ea881 In the getBitsSet function, don't optimize for a common case that is
already covered by getLowBitsSet (i.e. when loBits==0). Consequently, remove
the default value for loBits and reorder the arguments to the more natural
loBits, hiBits order. This makes it more clear that this function is for bit
groups in the middle of the bit width and not towards one end or the other.

llvm-svn: 35312
2007-03-24 23:42:47 +00:00
Reid Spencer
091d6cf3b7 Don't invoke undefined behavior in shifts in the functions getHighBitsSet
and getLowBitsSet.

llvm-svn: 35311
2007-03-24 23:35:54 +00:00
Reid Spencer
0e466b183f Implement the getBitsSet function.
llvm-svn: 35310
2007-03-24 23:27:48 +00:00
Reid Spencer
4887aba89f Remove the last vestiges of this directory.
llvm-svn: 35309
2007-03-24 23:07:49 +00:00
Reid Spencer
1aa3f64ef4 Implement the getHighBitsSet and getLowBitsSet functions.
llvm-svn: 35308
2007-03-24 23:05:35 +00:00
Reid Spencer
30351837ca Get the signs in the right place!
llvm-svn: 35307
2007-03-24 22:50:43 +00:00
Reid Spencer
7edbb3082f Fix a link.
llvm-svn: 35306
2007-03-24 22:40:44 +00:00
Reid Spencer
0ceb493ee2 Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.

llvm-svn: 35305
2007-03-24 22:37:23 +00:00
Reid Spencer
0a9a2200a6 Flip the srem tests around. Previous commit was to correct an apparent
bug in the srem implementation. Turns out it was a documentation bug
instead.

llvm-svn: 35304
2007-03-24 22:34:10 +00:00
Reid Spencer
88d0496d66 Correct the description of srem. remainder follows the dividend not the
divisor!

llvm-svn: 35303
2007-03-24 22:23:39 +00:00
Reid Spencer
c1dfceab8b Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.

llvm-svn: 35302
2007-03-24 21:56:22 +00:00
Reid Spencer
ffa19b617d Fix incorrect test cases for srem. The definition of srem is a remainder so
that the sign of the result follows the sign of the divisor.

llvm-svn: 35301
2007-03-24 21:55:26 +00:00
Reid Spencer
52ea41bb97 Clean up this interface:
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.

llvm-svn: 35300
2007-03-24 18:09:18 +00:00
Chris Lattner
57d0c197e6 don't rely on ADL
llvm-svn: 35299
2007-03-24 17:37:03 +00:00
Chris Lattner
3a16450eaf add a valuetype for v1i64, which is needed by mmx.
llvm-svn: 35298
2007-03-24 17:36:26 +00:00