Owen Anderson
41bf50021d
Expunge DomSet from CodeExtractor. This is part of the continuing work
...
on PR1171.
llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Chris Lattner
b30cb05d63
add loop rot
...
llvm-svn: 35722
2007-04-07 04:43:02 +00:00
Devang Patel
562df7f986
Add loop rotation pass.
...
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
0160bf7114
rearchitect the registration mechanism used by the command line option stuff.
...
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called. In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main. Most of that
memory is now allocated by non-commandline related stuff.
llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner
d0cc2333d1
Switch some vectors to smallvectors. This reduces amount of malloc'd
...
memory that occurs before main starts from 5104 to 4864 bytes with a dummy
example app.
llvm-svn: 35698
2007-04-06 18:36:18 +00:00
Chris Lattner
2f1c6daeae
Eliminate unneeded virtual methods
...
llvm-svn: 35697
2007-04-06 18:06:27 +00:00
Reid Spencer
5d36a01dba
For PR1209:
...
Implement Type class's ContainedTys without using a std::vector.
llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Chris Lattner
4272783ca4
eliminate a virtual method
...
llvm-svn: 35691
2007-04-05 22:21:39 +00:00
Chris Lattner
d33f94f2d2
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
d39ae2fa6d
Add a helper class (APSInt) which can represent an APInt along with sign
...
information. This is useful when a value does have a sign associated with
it. This shouldn't be used generally in LLVM for mid-level optimizer stuff.
llvm-svn: 35681
2007-04-05 05:20:11 +00:00
Reid Spencer
6eb55df794
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Lauro Ramos Venancio
2dfc0515a6
Fix release build.
...
llvm-svn: 35676
2007-04-04 22:13:39 +00:00
Anton Korobeynikov
e16f421e0e
Properly emit range comparisons for switch cases, where neighbour cases
...
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase
llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Evan Cheng
a8c9533e3e
Add isFixedObjectIndex. It returns true if the stack slot index is for a fixed stack object.
...
llvm-svn: 35659
2007-04-04 07:38:25 +00:00
Reid Spencer
a54d904575
Make the LinkInFile and LinkInLibrary both return an indication of whether
...
the file was found to be a native library (and thus not linked by these
functions).
llvm-svn: 35652
2007-04-04 06:32:01 +00:00
Reid Spencer
6dc38e6fbd
For PR1302:
...
Make the FileType enumerators more readable and add COFF, ELF and Mach-O.
llvm-svn: 35649
2007-04-04 06:29:49 +00:00
Chris Lattner
5d12d66728
trivial optimization
...
llvm-svn: 35648
2007-04-04 06:18:21 +00:00
Chris Lattner
8a4ca643dd
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
60c84ed4e9
Initialize the symbol table to zero explicitly. This ensures that the
...
symbol table does no allocations for prototypes or other lazily deserialized
functions, saving significant space and time.
llvm-svn: 35643
2007-04-04 00:30:49 +00:00
Chris Lattner
dbf6a79a71
Extend StringMap to support being initialized as completely empty. When
...
initialized this way, they do not do a malloc to allocate their buckets.
llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Bill Wendling
a4aa65bc38
Adding more MMX instructions.
...
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Bill Wendling
ca2124e5a9
Add FEMMS and ADDQ. Renamed MMX recipes to prepend the MMX_ to them.
...
llvm-svn: 35616
2007-04-03 06:00:37 +00:00
Chris Lattner
b5e5784b28
add missing operator
...
llvm-svn: 35613
2007-04-03 04:25:46 +00:00
Chris Lattner
96c4c71f2c
add a helper function to constantint.
...
llvm-svn: 35610
2007-04-03 01:41:34 +00:00
Evan Cheng
d0366b0024
Ugh. Copy coalescer does not update register numbers.
...
llvm-svn: 35600
2007-04-02 18:49:18 +00:00
Chris Lattner
3ff8b2cf06
add a helper function.
...
llvm-svn: 35585
2007-04-02 05:41:00 +00:00
Chris Lattner
b59fc9767b
add range version of insert()
...
llvm-svn: 35572
2007-04-02 01:21:19 +00:00
Zhou Sheng
551fa60212
Remove unused methods.
...
llvm-svn: 35553
2007-04-01 12:45:33 +00:00
Reid Spencer
419396d2fe
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.
llvm-svn: 35544
2007-04-01 07:30:57 +00:00
Reid Spencer
5ac41f7bc9
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.
llvm-svn: 35543
2007-04-01 07:28:37 +00:00
Reid Spencer
e1b0aae7c7
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.
llvm-svn: 35542
2007-04-01 07:26:35 +00:00
Reid Spencer
f4ea8f8a73
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.
llvm-svn: 35538
2007-04-01 07:17:45 +00:00
Chris Lattner
579b1c63d5
Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
...
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Chris Lattner
8747705792
switch TL::getValueType to use MVT::getValueType.
...
llvm-svn: 35527
2007-03-31 04:05:24 +00:00
Chris Lattner
546138e3dd
add a method to turn a type into a VT.
...
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Chris Lattner
143464e05f
add one addressing mode description hook to rule them all.
...
llvm-svn: 35520
2007-03-30 23:14:50 +00:00
Zhou Sheng
68b7faad88
Make sure this method just return value equal or less than Limit.
...
llvm-svn: 35509
2007-03-30 16:50:28 +00:00
Duncan Sands
def480579a
Correct typo.
...
llvm-svn: 35504
2007-03-30 06:39:42 +00:00
Zhou Sheng
3352181fc8
Rename and correct the method "greaterOrEqual".
...
llvm-svn: 35502
2007-03-30 05:10:59 +00:00
Zhou Sheng
489a1dbb92
Add two utility methods into ConstantInt.
...
llvm-svn: 35501
2007-03-30 03:22:55 +00:00
Reid Spencer
4269ae1274
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.
llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Chris Lattner
1c3ed414f6
add a hook to demat functions.
...
llvm-svn: 35471
2007-03-29 18:30:26 +00:00
Jeff Cohen
e38e3a8a5d
uniqueID is a uint64_t (caught by VC++)
...
llvm-svn: 35465
2007-03-29 17:28:31 +00:00
Reid Spencer
d0eb672f1e
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.
llvm-svn: 35461
2007-03-29 17:00:31 +00:00
Reid Spencer
c767f6f709
Don't forget to delete the FileStatus structure on destruction of Path.
...
llvm-svn: 35459
2007-03-29 16:50:49 +00:00
Reid Spencer
fc67ef7cfe
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.
llvm-svn: 35456
2007-03-29 16:43:20 +00:00
Evan Cheng
a55449c051
Remove isLegalAddressImmediate.
...
llvm-svn: 35406
2007-03-28 01:53:55 +00:00
Bill Wendling
f9c5de3792
Add support for integer comparison builtins.
...
llvm-svn: 35384
2007-03-27 20:21:31 +00:00
Evan Cheng
201771637e
Change findRegisterUseOperand() to return operand index instead.
...
llvm-svn: 35363
2007-03-26 22:37:45 +00:00
Dale Johannesen
3ad8ab7b61
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
Bill Wendling
a42484728c
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
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
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
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
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
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
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
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
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
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
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
3a16450eaf
add a valuetype for v1i64, which is needed by mmx.
...
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Bill Wendling
ad01036d5c
This is dead. DEAD I tells you!!
...
llvm-svn: 35291
2007-03-23 22:42:04 +00:00
Bill Wendling
124f2c8706
PR1260:
...
Add final support to get the QT example to compile.
llvm-svn: 35290
2007-03-23 22:35:46 +00:00
Dan Gohman
42a3f4e16e
Add the 'explicit' keyword to several constructors that accept one
...
argument that don't appear intended as implicit-conversion operators.
llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Bill Wendling
e6a9c6dfe6
We generate a shufflevector instruction, so we don't need the builtin
...
intrinsic.
llvm-svn: 35269
2007-03-22 20:29:26 +00:00
Jeff Cohen
2f87ca6cc7
Be more explicit concerning argument sizes.
...
Use VC++ byteswap intrinsics.
llvm-svn: 35267
2007-03-22 19:11:57 +00:00
Bill Wendling
1bcad4c1cd
Support added for shifts and unpacking MMX instructions.
...
llvm-svn: 35266
2007-03-22 18:42:45 +00:00
Reid Spencer
17f3eeaf48
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.
llvm-svn: 35250
2007-03-22 00:32:02 +00:00
Reid Spencer
76c1fef30a
Fix a comment.
...
llvm-svn: 35246
2007-03-21 22:22:19 +00:00
Dale Johannesen
44c0a5d545
repair x86 performance, dejagnu problems from previous change
...
llvm-svn: 35245
2007-03-21 21:51:52 +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
Dale Johannesen
50a22f6fe6
maintain LiveIn when splitting blocks (register scavenging needs it)
...
llvm-svn: 35226
2007-03-20 21:35:06 +00:00
Devang Patel
19dae84536
LoopSimplify::FindPHIToPartitionLoops()
...
Use ETForest instead of DominatorSet.
llvm-svn: 35222
2007-03-20 20:19:48 +00:00
Evan Cheng
0176b9859d
First cut trivial re-materialization support.
...
llvm-svn: 35208
2007-03-20 08:13:50 +00:00
Evan Cheng
41f4f032ee
Added MRegisterInfo hook to re-materialize an instruction.
...
llvm-svn: 35205
2007-03-20 08:09:38 +00:00
Zhou Sheng
a9c0018850
Correct the name: isStrictPositive --> isStrictlyPositive.
...
llvm-svn: 35201
2007-03-20 02:18:16 +00:00
Chris Lattner
305c3525af
Add a dtor to fix leaks from all clients of BitVector.
...
llvm-svn: 35200
2007-03-20 02:10:56 +00:00
Reid Spencer
7d20e42a97
Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
...
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
c3422e56d6
Add an indication of signedness to the uint64_t constructor so sign bits
...
can be extended. This helps fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35179
2007-03-19 20:36:48 +00:00
Duncan Sands
90c42a15d5
Fix obvious typo in comment.
...
llvm-svn: 35164
2007-03-19 14:25:02 +00:00
Evan Cheng
2081cf96ed
Add a TargetInstrDescriptor flag to mark an instruction as "re-materializable".
...
It means the instruction can be easily re-materialized at any point. e.g.
constant generation, load from constantpool.
llvm-svn: 35158
2007-03-19 06:19:16 +00:00
Zhou Sheng
6ecf1045a6
Add isStrictPositive() to APInt to determine if this APInt Value > 0.
...
llvm-svn: 35156
2007-03-19 05:22:18 +00:00
Evan Cheng
1d943badac
Fix comment.
...
llvm-svn: 35139
2007-03-18 03:26:04 +00:00
Evan Cheng
5be8544e8a
Track the BB's where each virtual register is used.
...
llvm-svn: 35135
2007-03-17 09:29:54 +00:00
Evan Cheng
ce8b779c6c
Added isLegalAddressExpression hook to test if the given expression can be
...
folded into target addressing mode for the given type.
llvm-svn: 35121
2007-03-16 08:42:32 +00:00
Evan Cheng
0408dc0d37
These forward declarations are not needed.
...
llvm-svn: 35120
2007-03-16 08:41:06 +00:00
Bill Wendling
feaff80149
Multiplication support for MMX.
...
llvm-svn: 35118
2007-03-15 21:24:36 +00:00
Jeff Cohen
b19ec59b5c
Fix for VS 2005 problem supplied by Morten Ofstad.
...
llvm-svn: 35098
2007-03-14 15:25:21 +00:00
Zhou Sheng
dfcf9376bc
Add zextOrCopy() into APInt for convenience.
...
llvm-svn: 35079
2007-03-13 06:16:26 +00:00
Evan Cheng
f132fa5bba
More flexible TargetLowering LSR hooks for testing whether an immediate is
...
a legal target address immediate or scale.
llvm-svn: 35071
2007-03-12 23:26:27 +00:00
Zhou Sheng
9643d0a422
Add getSignBit() and operator<<= into APInt for convenience.
...
llvm-svn: 35059
2007-03-11 07:16:10 +00:00
Nick Lewycky
2af4a3ab17
Add getter methods for the extremes of a ConstantRange.
...
llvm-svn: 35056
2007-03-10 15:54:12 +00:00
Bill Wendling
236cfc4344
Adding more arithmetic operators to MMX. This is an almost exact copy of
...
the addition. Please let me know if you have suggestions.
llvm-svn: 35055
2007-03-10 09:57:05 +00:00
Bill Wendling
5fef3fd7e7
Added "padd*" support for MMX. Added MMX move stuff to X86InstrInfo so that
...
moves, loads, etc. are recognized.
llvm-svn: 35031
2007-03-08 22:09:11 +00:00