Commit Graph

31061 Commits

Author SHA1 Message Date
Dale Johannesen fd18a0cdf4 Fix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to
hopefully forestall similar errors.

llvm-svn: 35362
2007-03-26 22:23:54 +00:00
Chris Lattner d2602d5054 eliminate use of std::set
llvm-svn: 35361
2007-03-26 20:40:50 +00:00
Reid Spencer e20090b88d Add a comment to explain a folding transform.
llvm-svn: 35360
2007-03-26 20:09:02 +00:00
Reid Spencer d9fe01c7a4 Fix this test case to match output after a bug was fixed.
llvm-svn: 35359
2007-03-26 18:04:38 +00:00
Reid Spencer 755d0e7ffc Get better debug output by having modified instructions print both the
original and new instruction. A slight performance hit with ostringstream
but it is only for debug.
Also, clean up an uninitialized variable warning noticed in a release build.

llvm-svn: 35358
2007-03-26 17:44:01 +00:00
Reid Spencer 769a5a8e0b Get the number of bits to set in a mask correct for a shl/lshr transform.
llvm-svn: 35357
2007-03-26 17:18:58 +00:00
Duncan Sands 820ae03fda Fix testsuite hang.
llvm-svn: 35355
2007-03-26 10:59:13 +00:00
Reid Spencer 2853e602d4 For PR601:
Initial skeleton for pass documentation.

llvm-svn: 35354
2007-03-26 09:32:31 +00:00
Bill Wendling 158f6092a2 Promote to v1i64 type...
llvm-svn: 35353
2007-03-26 08:03:33 +00:00
Bill Wendling 48a24419bf Updated.
llvm-svn: 35352
2007-03-26 07:55:58 +00:00
Bill Wendling 98d2104c6f Add support for the v1i64 type. This makes better code for this:
#include <mmintrin.h>

extern __m64 C;

void baz(__v2si *A, __v2si *B)
{
  *A = C;
  _mm_empty();
}

We get this:

_baz:
        call "L1$pb"
"L1$pb":
        popl %eax
        movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
        movq (%eax), %mm0
        movl 4(%esp), %eax
        movq %mm0, (%eax)
        emms
        ret

GCC gives us this:

_baz:
        pushl   %ebx
        call    L3
"L00000000001$pb":
L3:
        popl    %ebx
        subl    $8, %esp
        movl    L_C$non_lazy_ptr-"L00000000001$pb"(%ebx), %eax
        movl    (%eax), %edx
        movl    4(%eax), %ecx
        movl    16(%esp), %eax
        movl    %edx, (%eax)
        movl    %ecx, 4(%eax)
        emms
        addl    $8, %esp
        popl    %ebx
        ret

llvm-svn: 35351
2007-03-26 07:53:08 +00:00
Evan Cheng 8275f0e0af SIGN_EXTEND_INREG requires one extra operand, a ValueType node.
llvm-svn: 35350
2007-03-26 07:12:51 +00:00
Reid Spencer 0bfa19eb13 Test case for PR1271 involving construction of a bad mask to replace a
shift instruction.

llvm-svn: 35349
2007-03-26 05:32:16 +00:00
Reid Spencer 50898607a9 For PR1271:
Fix SingleSource/Regression/C/2003-05-21-UnionBitFields.c by changing a
getHighBitsSet call to getLowBitsSet call that was incorrectly converted
from the original lshr constant expression.

llvm-svn: 35348
2007-03-26 05:25:00 +00:00
Dale Johannesen e5866e7b89 Look through bitcast when finding IVs. (Chris' patch really.)
llvm-svn: 35347
2007-03-26 03:01:27 +00:00
Chris Lattner 7a86dc5c27 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 6e30008249 Add "feature" testcase for new switch lowering code
llvm-svn: 35345
2007-03-25 22:01:14 +00:00
Reid Spencer 8314b16fc3 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 726b0a7fa4 Add a test case for PR1271 (necessary, but not sufficient).
llvm-svn: 35343
2007-03-25 21:30:41 +00:00
Reid Spencer 52830327e9 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 9bf53ffaa2 implement Transforms/InstCombine/cast2.ll:test3 and PR1263
llvm-svn: 35341
2007-03-25 20:43:09 +00:00
Chris Lattner f323838c4c new testcase
llvm-svn: 35340
2007-03-25 20:42:40 +00:00
Reid Spencer 624766f8a2 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 7037826c86 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 e8ac2fce97 Fix authorship
llvm-svn: 35337
2007-03-25 13:44:26 +00:00
Chris Lattner 6d94bb79ac fold constantexprs more aggressively, fixing PR1265
llvm-svn: 35336
2007-03-25 05:47:04 +00:00
Reid Spencer 80263aadf3 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 26ad3e7191 add a note
llvm-svn: 35334
2007-03-25 05:10:46 +00:00
Zhou Sheng 222d5ebfd2 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 77f0479833 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 25f82845b3 new testcase
llvm-svn: 35331
2007-03-25 05:00:23 +00:00
Chris Lattner 9c9e2f1af2 add a note
llvm-svn: 35330
2007-03-25 04:46:28 +00:00
Chris Lattner 8810241ebc Fix CodeGen/PowerPC/2007-03-24-cntlzd.ll
llvm-svn: 35329
2007-03-25 04:44:03 +00:00
Chris Lattner 31b80d55ee test that the ppc backend can do 64-bit cntlz
llvm-svn: 35328
2007-03-25 04:43:51 +00:00
Chris Lattner 3d7efa2586 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 6089146aa3 new testcase
llvm-svn: 35326
2007-03-25 04:35:23 +00:00
Reid Spencer cd99fbdf3b 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 843e44503c Implement CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
llvm-svn: 35324
2007-03-25 02:18:14 +00:00
Chris Lattner f4579c7872 new testcase
llvm-svn: 35323
2007-03-25 02:17:58 +00:00
Chris Lattner d685514e2e 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 d8aad61d4d 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 927f30da08 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 03a643aa69 enforce the proper range for the i386 N constraint.
llvm-svn: 35319
2007-03-25 01:57:35 +00:00
Chris Lattner c8ddca703d Fix test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
llvm-svn: 35318
2007-03-25 01:44:57 +00:00
Chris Lattner 421ac38bd6 new testcase
llvm-svn: 35317
2007-03-25 01:44:40 +00:00
Reid Spencer 9bb967ec5c Fix a typo in a comment.
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer d4e07f200a 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 3a8248f79d fix a regression on vector or instructions.
llvm-svn: 35314
2007-03-24 23:56:43 +00:00
Reid Spencer 42fbb4fbe3 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 790631ff2d 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