Commit Graph

5052 Commits

Author SHA1 Message Date
Chris Lattner
febabcc02a add a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 05:41:00 +00:00
Chris Lattner
086f186267 add range version of insert()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35572 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:21:19 +00:00
Zhou Sheng
770e1798e1 Remove unused methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35553 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 12:45:33 +00:00
Reid Spencer
dc722d6516 For PR1297:
Implement bswap, ctpop, ctlz, and cttz utilizing the new overloaded
intrinsic feature of tblgen. By defining llvm_int_ty to have an ValueType
of iAny, any intrinsic using that type becomes an overloaded intrinsic.
This signals that a) any integer type could be used for that argument and
b) the intrinsic needs a suffix to match each such argument for the
actual intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:30:57 +00:00
Reid Spencer
ded5ed873f For PR1297:
Intrinsic functions might need to be generated (if they are overloaded) so
returning a const char* is no longer possible. Change getOperationName to
return a std::string instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:28:37 +00:00
Reid Spencer
d4d68ba4b8 For PR1297:
Change the interface to the getName, getType, getDeclaration methods to
include the "actual" types of the result/arguments. This is necessary to
support overloaded intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:26:35 +00:00
Reid Spencer
86a5a368f8 For PR1297:
Add an "iAny" ValueType as a place holder for an integer type of any
bit width. This is used for intrinsics overloading on integer type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35538 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:17:45 +00:00
Chris Lattner
dbe0deca33 Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35528 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:06:36 +00:00
Chris Lattner
d2f340b746 switch TL::getValueType to use MVT::getValueType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35527 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:05:24 +00:00
Chris Lattner
2df6dc579c add a method to turn a type into a VT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:03:02 +00:00
Chris Lattner
1436bb657d add one addressing mode description hook to rule them all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 23:14:50 +00:00
Zhou Sheng
4ac93f9fa3 Make sure this method just return value equal or less than Limit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 16:50:28 +00:00
Duncan Sands
48a3e98c27 Correct typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 06:39:42 +00:00
Zhou Sheng
0642f75836 Rename and correct the method "greaterOrEqual".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 05:10:59 +00:00
Zhou Sheng
b422d2d9e5 Add two utility methods into ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 03:22:55 +00:00
Reid Spencer
8475ec068c For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:05:44 +00:00
Chris Lattner
a37ddb5296 add a hook to demat functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 18:30:26 +00:00
Jeff Cohen
b9681893c8 uniqueID is a uint64_t (caught by VC++)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:28:31 +00:00
Reid Spencer
4031befb62 Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:00:31 +00:00
Reid Spencer
a5cb38980b Don't forget to delete the FileStatus structure on destruction of Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 16:50:49 +00:00
Reid Spencer
69cce815e7 For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35456 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 16:43:20 +00:00
Evan Cheng
caaf69107e Remove isLegalAddressImmediate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35406 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-28 01:53:55 +00:00
Bill Wendling
b94827769a Add support for integer comparison builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-27 20:21:31 +00:00
Evan Cheng
32eb1f1ca4 Change findRegisterUseOperand() to return operand index instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35363 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-26 22:37:45 +00:00
Dale Johannesen
c6b9ef80a8 Fix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to
hopefully forestall similar errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35362 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-26 22:23:54 +00:00
Bill Wendling
eebc8a1bc5 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35351 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-26 07:53:08 +00:00
Chris Lattner
5eeb4b5bf6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-26 01:45:35 +00:00
Reid Spencer
f6bef488ee 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35344 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-25 21:58:42 +00:00
Anton Korobeynikov
3a84b9baf6 First step of switch lowering refactoring: perform worklist-driven
strategy, emit JT's where possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35338 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-25 15:07:15 +00:00
Chris Lattner
4234f57fa0 switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-25 02:14:49 +00:00
Reid Spencer
5b9f2d6186 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35316 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-25 01:13:46 +00:00
Reid Spencer
a1689ea60e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-25 00:01:47 +00:00
Reid Spencer
758d1bc919 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35313 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 23:47:58 +00:00
Reid Spencer
5b7e659e22 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35312 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 23:42:47 +00:00
Reid Spencer
ca76fc2cd3 Don't invoke undefined behavior in shifts in the functions getHighBitsSet
and getLowBitsSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 23:35:54 +00:00
Reid Spencer
8f969ee62c Implement the getBitsSet function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35310 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 23:27:48 +00:00
Reid Spencer
8da7d65b83 Implement the getHighBitsSet and getLowBitsSet functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 23:05:35 +00:00
Reid Spencer
013263f7b0 Get the signs in the right place!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 22:50:43 +00:00
Reid Spencer
d3af825d29 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35305 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 22:37:23 +00:00
Reid Spencer
53c9520b23 Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35302 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 21:56:22 +00:00
Reid Spencer
7ac2f81e49 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 18:09:18 +00:00
Chris Lattner
0d3988f408 add a valuetype for v1i64, which is needed by mmx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35298 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-24 17:36:26 +00:00
Bill Wendling
b172ab0533 This is dead. DEAD I tells you!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35291 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-23 22:42:04 +00:00
Bill Wendling
b8440a0c39 PR1260:
Add final support to get the QT example to compile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35290 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-23 22:35:46 +00:00
Dan Gohman
423c2260f9 Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-23 18:44:11 +00:00
Bill Wendling
02ced83ce7 We generate a shufflevector instruction, so we don't need the builtin
intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35269 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-22 20:29:26 +00:00
Jeff Cohen
c3c395cf5e Be more explicit concerning argument sizes.
Use VC++ byteswap intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35267 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-22 19:11:57 +00:00
Bill Wendling
a348c56fde Support added for shifts and unpacking MMX instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-22 18:42:45 +00:00
Reid Spencer
ac86cc1b7e For PR1145:
Add the NoUnwindAttribute to allow explicit marking of functions that do
not unwind the stack via the unwind instruction. This is akin to gcc's
NoThrow attribute and used for optimizing exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35250 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-22 00:32:02 +00:00
Reid Spencer
3a3aacfe10 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-21 22:22:19 +00:00