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
Evan Cheng
6bf2f3665e
Add ReadOnlySection directive.
...
llvm-svn: 35015
2007-03-08 01:00:38 +00:00
Evan Cheng
7513c95267
Added ContainsRelocations() to check if a constant might only be resolvable at load time.
...
llvm-svn: 35014
2007-03-08 00:59:12 +00:00
Anton Korobeynikov
85d6c1ebad
Refactoring of formal parameter flags. Enable properly use of
...
zext/sext/aext stuff.
llvm-svn: 35008
2007-03-07 16:25:09 +00:00
Evan Cheng
d4fb00bb6b
Add a utility function to test whether a load is unindexed.
...
llvm-svn: 35004
2007-03-07 08:04:41 +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
Anton Korobeynikov
090c2d50ea
Fix DWARF debugging information on x86/Linux and (hopefully)
...
Mingw32/Cygwin targets. This fixes PR978
llvm-svn: 35000
2007-03-07 02:47:57 +00:00
Evan Cheng
4161981d63
Add skipTo to set internal iterator. Useful when pointed to instruction is deleted.
...
llvm-svn: 34997
2007-03-07 02:36:16 +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
Devang Patel
0b82378a28
Now LoopStrengthReduce is a LoopPass.
...
llvm-svn: 34984
2007-03-06 21:14:09 +00:00
Devang Patel
57322d0462
Use schedulePass() instead of assignPassManager() to add new LPPassManager.
...
This ensures that require analysis info is available.
llvm-svn: 34980
2007-03-06 19:11:25 +00:00
Devang Patel
b44e86318e
Add LPPassManager::insertLoop().
...
llvm-svn: 34979
2007-03-06 19:00:02 +00:00
Devang Patel
8490ffbcdc
LPPassManager::deleteLoopFromQueue() add meat. Cut-n-paste code from
...
LoopUnswitch pass.
llvm-svn: 34977
2007-03-06 18:38:33 +00:00
Devang Patel
d3cf506865
LPPassManager. Implement preparePassManager() hook.
...
llvm-svn: 34975
2007-03-06 17:59:37 +00:00
Devang Patel
b9e705f09e
Keep track of higher level analysis.
...
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel
e3abf559e5
LPPassManager : Add initialization and finalizatino hooks.
...
llvm-svn: 34968
2007-03-06 16:59:03 +00:00
Evan Cheng
b0c0d22f30
Minor interface change.
...
llvm-svn: 34967
2007-03-06 10:05:14 +00:00
Evan Cheng
077516f441
Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
...
llvm-svn: 34964
2007-03-06 10:01:25 +00:00
Anton Korobeynikov
4558f01db9
Enumerate SDISel formal parameter attributes. Make use of new
...
enumeration.
llvm-svn: 34960
2007-03-06 06:10:33 +00:00
Anton Korobeynikov
d0375d0852
Implement PR1240
...
llvm-svn: 34959
2007-03-06 05:32:48 +00:00
Reid Spencer
564f193ad0
Make StoreValueToMemory a little more efficient by not copying a
...
GenericValue to a temporary.
llvm-svn: 34957
2007-03-06 05:02:28 +00:00
Reid Spencer
b5e0b0bc5e
Make GenericeValue into a struct with a union instead of just a union. This
...
allows an APInt value to be constructed. Remove all the native integer types
from the union. These are replaced with the single IntVal of type APInt.
llvm-svn: 34945
2007-03-06 03:01:54 +00:00
Devang Patel
e4da6fa801
Use std::deque to manage loop queue inside LPPassManager.
...
llvm-svn: 34943
2007-03-06 02:30:46 +00:00
Devang Patel
45343b04b3
Keep track of inherited analysis. For example, if a loop pass does not
...
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
llvm-svn: 34942
2007-03-06 01:55:46 +00:00
Devang Patel
edbde240be
Add preparePassManager() hook. This allows each pass to check whether
...
current active pass manager is appropriate or not.
A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this hook
and use new LPPassManager for itself.
llvm-svn: 34941
2007-03-06 01:06:16 +00:00
Bill Wendling
c52174dee3
Add the emms intrinsic for MMX support.
...
llvm-svn: 34938
2007-03-05 23:09:45 +00:00
Reid Spencer
5ecf7f6214
Document the use of getValueType() more accurately, specifically explain
...
that the instruction opcode is added to the InstructionVal value and the
consequences of that.
llvm-svn: 34937
2007-03-05 23:06:32 +00:00
Devang Patel
79495d839e
Current pass manager, not the parent pass manager, assumes the role of
...
last user when one of the managed pass uses info provided by parent pass
manager.
This was exposed by LPPassManager work.
llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Devang Patel
6668a341ae
Avoid constructing std::strings unless pass debugging is ON.
...
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Jeff Cohen
84d84f7381
The hack won't work on VS 2005, and it might not be needed anyway.
...
llvm-svn: 34930
2007-03-05 17:22:33 +00:00
Zhou Sheng
b6d1ac8682
Correct the calculation in APInt::logBase2().
...
llvm-svn: 34929
2007-03-05 16:42:58 +00:00
Jeff Cohen
b58af23ff3
Elminate tabs and improve comments.
...
llvm-svn: 34921
2007-03-05 00:46:22 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
7fdddda045
add a getSignBit method, elimiante virtual method from getBitMask()
...
llvm-svn: 34916
2007-03-04 23:33:19 +00:00
Chris Lattner
69aafa4be8
fix 80 col violations, mark arrays static
...
llvm-svn: 34915
2007-03-04 23:33:03 +00:00
Chris Lattner
295b3d69b1
add a new node
...
llvm-svn: 34912
2007-03-04 20:40:06 +00:00
Chris Lattner
2510829eba
add iterator range version of ctor.
...
llvm-svn: 34899
2007-03-04 04:04:43 +00:00
Reid Spencer
cdb5aa2805
Make the creation functions take an error string. This will help the
...
ExecutionEngine report errors on creation (like bytecode stuff) and also
help to get rid of exception handling.
llvm-svn: 34886
2007-03-03 18:18:11 +00:00
Reid Spencer
e96b55e61f
Require the destination GlobalValue for LoadValueFromMemory to be passed
...
in as a parameter instead of returned.
llvm-svn: 34882
2007-03-03 08:35:14 +00:00
Reid Spencer
e2bf55dfe8
Regularize the interface for conversion functions to/from float/double.
...
llvm-svn: 34881
2007-03-03 08:34:02 +00:00
Reid Spencer
36fb227e99
Add APIntVal as a possible GenericeValue.
...
llvm-svn: 34879
2007-03-03 07:36:44 +00:00
Reid Spencer
503dda5840
Make getNumWords public so that those using getRawData stand a chance of
...
not reading beyond the end of the buffer returned.
llvm-svn: 34873
2007-03-03 06:17:23 +00:00
Reid Spencer
47b01d6acb
Add names for some of the operators. This is needed for the macros in
...
the Interpreter.
llvm-svn: 34872
2007-03-03 05:37:23 +00:00
Reid Spencer
e5244b132b
Add isPositive for symmetry with isNegative.
...
llvm-svn: 34862
2007-03-03 00:24:39 +00:00
Anton Korobeynikov
af46a0e4a2
Fix uninitialized use of variable. Remove tabs and fix identation.
...
llvm-svn: 34850
2007-03-02 22:19:41 +00:00
Chris Lattner
68244ce570
Fix PR1234 by working around a compiler bug.
...
llvm-svn: 34845
2007-03-02 18:16:29 +00:00
Owen Anderson
6d3b179de3
Fix a typo.
...
llvm-svn: 34836
2007-03-02 05:03:07 +00:00
Evan Cheng
44257955c8
Make it 64-bit safe.
...
llvm-svn: 34829
2007-03-02 02:31:37 +00:00
Reid Spencer
53a673b3ed
Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
...
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.
llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer
d86182b19b
Add an abs() function to get the absolute value.
...
llvm-svn: 34819
2007-03-01 23:37:09 +00:00
Reid Spencer
c5d33cef76
Remove virtual keyword from method that doesn't need to be virtual.
...
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer
ee77d22f26
Make it possible to create an SCEVUnknown from an APInt as well as an int.
...
llvm-svn: 34816
2007-03-01 22:28:51 +00:00
Reid Spencer
2ce72a4bd8
Add an isUnitValue method for comparison against 1. This just follows a
...
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.
llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Owen Anderson
070c37407c
Use GCC intrinsics when available, and use smarter fallbacks when not.
...
llvm-svn: 34812
2007-03-01 21:16:30 +00:00
Reid Spencer
003170430b
Add doubleToBits and floatToBits methods.
...
llvm-svn: 34807
2007-03-01 20:39:01 +00:00
Jim Laskey
73e3ad1b10
Collect eh filter info.
...
llvm-svn: 34804
2007-03-01 20:25:32 +00:00
Jim Laskey
88c98a4128
Add eh filter intrinsic.
...
llvm-svn: 34801
2007-03-01 20:23:39 +00:00
Reid Spencer
90b6227b81
Add bitsToDouble and bitsToFloat methods for re-interpretation of bits as FP.
...
llvm-svn: 34800
2007-03-01 20:06:51 +00:00
Reid Spencer
b4e877c488
Drop the ConstantInt(const Type&, const APInt&) constructor. It is
...
redundant and more verbose than the ConstantInt(const APInt&) constructor.
llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
6a95676875
Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
...
llvm-svn: 34789
2007-03-01 17:15:32 +00:00
Evan Cheng
0aa68b9246
Add a version of FindUnusedReg that restrict search to a specific set of registers.
...
llvm-svn: 34784
2007-03-01 08:56:24 +00:00
Reid Spencer
3f3487918c
Remove the "isSigned" parameters from ConstantRange. It turns out they
...
are not needed as the results are the same with or without it.
Patch by Nicholas Lewycky.
llvm-svn: 34782
2007-03-01 07:54:15 +00:00
Owen Anderson
cbbf9aa6b0
Use the GCC built-in for PopulationCount when it's available, and use a faster
...
algorithm when it's not. This should be particularly noticeable in the
64-bit case.
llvm-svn: 34776
2007-03-01 05:41:28 +00:00
Reid Spencer
b6dd32889e
Add a square root function.
...
llvm-svn: 34775
2007-03-01 05:39:56 +00:00
Reid Spencer
32d0051c64
Reduce #includage by taking a method out of line.
...
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Reid Spencer
4937dcdf1f
Add an IntegerType::getMask() method to get an APInt mask for the type.
...
llvm-svn: 34771
2007-03-01 02:25:03 +00:00
Evan Cheng
b2afac27e9
Clean up interface.
...
llvm-svn: 34769
2007-03-01 02:18:06 +00:00
Evan Cheng
d1fa618990
Track all joined registers and eliminate unneeded kills after all joining are done.
...
llvm-svn: 34767
2007-03-01 02:03:03 +00:00
Evan Cheng
0c89fbb835
MachineBasicBlock fields should not be public.
...
llvm-svn: 34766
2007-03-01 02:00:40 +00:00
Reid Spencer
f119927a6f
Move ConstantRange class to lib/Support from lib/Analysis and make its
...
interface not depend on Type or ICmpInst.
llvm-svn: 34761
2007-02-28 22:02:48 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Reid Spencer
965067a054
For PR1205:
...
Remove ConstantInt from ConstantRange interface and adjust its users to
compensate.
llvm-svn: 34758
2007-02-28 19:57:34 +00:00
Reid Spencer
a9d0cc903b
Implement a convenience method to construct a ConstantInt directly from an
...
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.
llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
e2b4631435
For PR1205:
...
First round of ConstantRange changes. This makes all CR constructors use
only APInt and not use ConstantInt. Clients are adjusted accordingly.
llvm-svn: 34756
2007-02-28 18:57:32 +00:00
Jim Laskey
1fea0fa316
Provide a more meaningful name.
...
llvm-svn: 34751
2007-02-28 18:37:50 +00:00
Reid Spencer
2b933467ad
For PR1205:
...
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.
llvm-svn: 34745
2007-02-28 17:36:23 +00:00
Reid Spencer
0f2d45e42c
Make APInt a little more friendly to its users:
...
* Add support for + and - of a uint64_t.
* Make trunc/sext/zext return *this so it can be chained with other ops
* Add smin, smax, umin, umax functions for getting min/max values.
llvm-svn: 34742
2007-02-28 17:33:36 +00:00
Nate Begeman
2288ec3331
More Mach-O writer improvements.
...
llvm-svn: 34740
2007-02-28 07:40:50 +00:00
Chris Lattner
6d383bd2f1
add methods for analysis of call results and return nodes.
...
llvm-svn: 34738
2007-02-28 07:09:40 +00:00
Chris Lattner
a68a949ba5
add methods to analyze calls and formals.
...
llvm-svn: 34736
2007-02-28 06:56:37 +00:00
Reid Spencer
949b3612a8
getActiveWords should return the number of words, not the index of the
...
highest active words. Increment its result by one.
llvm-svn: 34713
2007-02-28 02:20:49 +00:00
Evan Cheng
db591ecaa8
Make requiresRegisterScavenging determination on a per MachineFunction basis.
...
llvm-svn: 34711
2007-02-28 00:59:19 +00:00
Evan Cheng
ee2e5de4fb
MRegisterInfo disowns RegScavenger. It's immutable.
...
llvm-svn: 34706
2007-02-28 00:17:36 +00:00
Reid Spencer
355cec42d1
Add some syntactic sugar.
...
llvm-svn: 34704
2007-02-27 23:47:33 +00:00
Evan Cheng
ec12bdd7ea
Some more code clean up.
...
llvm-svn: 34700
2007-02-27 22:58:43 +00:00
Evan Cheng
2402ddad92
Oops.
...
llvm-svn: 34698
2007-02-27 22:10:52 +00:00
Reid Spencer
edbe747bab
Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
...
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000
llvm-svn: 34695
2007-02-27 21:59:26 +00:00
Evan Cheng
f03b87c1ff
RegScavenger interface change to make it more flexible.
...
llvm-svn: 34690
2007-02-27 21:09:48 +00:00
Evan Cheng
11d5b762b9
Let MRegisterInfo owns RegScavenger.
...
llvm-svn: 34689
2007-02-27 21:08:07 +00:00
Evan Cheng
561bf1736e
Pass IsImp, IsKill, and IsDead to ChangeToRegister.
...
llvm-svn: 34688
2007-02-27 21:06:57 +00:00
Reid Spencer
9e66d0921a
Improve APInt interface:
...
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
so simple.
3. Simplify sdiv and srem code.
llvm-svn: 34680
2007-02-27 20:24:31 +00:00
Reid Spencer
612dfe195b
Allow the RoundDoubleToAPInt function to specify a width to use.
...
llvm-svn: 34672
2007-02-27 18:22:31 +00:00
Devang Patel
89791371ce
Make getPassManagerType() const.
...
llvm-svn: 34669
2007-02-27 15:00:39 +00:00
Chris Lattner
11a1c2113c
Minor refactoring of CC Lowering interfaces
...
llvm-svn: 34656
2007-02-27 05:13:54 +00:00
Chris Lattner
e34136f6d5
move CC Lowering stuff to its own public interface
...
llvm-svn: 34655
2007-02-27 04:43:02 +00:00
Evan Cheng
341fc2bf88
forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.
...
llvm-svn: 34649
2007-02-27 01:58:48 +00:00
Reid Spencer
c8cc0f997e
For PR1205:
...
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.
llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Evan Cheng
0fd5788077
Joining an interval with a dead copy instruction. Shorten the live range to the last use.
...
llvm-svn: 34645
2007-02-26 21:37:37 +00:00
Reid Spencer
9bc19eab08
Fix indentation.
...
llvm-svn: 34643
2007-02-26 21:06:05 +00:00
Reid Spencer
18629544d3
1. Split getValue() into getSExtValue() and getZExtValue() to match
...
ConstantInt better.
2. Add a getHashValue() method.
llvm-svn: 34641
2007-02-26 20:57:12 +00:00
Reid Spencer
11f19f730c
Implement inline methods that make transition of ConstantInt to use APInt
...
easier to comprehend and might be useful elsewhere.
llvm-svn: 34635
2007-02-26 17:50:32 +00:00
Reid Spencer
1252a271a1
Make isNegative() a const function since it doesn't modify the APInt.
...
llvm-svn: 34630
2007-02-26 07:45:40 +00:00
Reid Spencer
e8e8ea4fba
Add an isNegative method to determine if the APInt's value is negative.
...
This is much less expensive than a test against zero.
llvm-svn: 34619
2007-02-26 01:20:59 +00:00
Chris Lattner
50be7cd320
Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
...
exprs hanging off a global, even if the global is not otherwise dead. This
requires some tricky iterator gymnastics.
This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.
llvm-svn: 34608
2007-02-25 21:06:13 +00:00
Reid Spencer
a4ab1c36d2
Fix clearUnusedBits to not depend on "undefined behavior" of >> operator
...
when the bit size is equal to the word size. This happens to work out okay
on x86, but might not on other platforms. The change just detects when
there are no bits to clear (because BitWidth is a multiple of the word size)
and returns early.
Also, move some comments from .cpp file into header.
llvm-svn: 34602
2007-02-25 19:26:01 +00:00
Reid Spencer
e7d8a0e3b7
Add a private constructor for efficiency.
...
llvm-svn: 34580
2007-02-25 07:29:03 +00:00
Reid Spencer
a2a4a55915
Improve documentation.
...
Make divide function internal (it was briefly external for testing).
llvm-svn: 34557
2007-02-24 09:50:13 +00:00
Chris Lattner
0eb72353e4
Refactor the setName stuff, moving it down the inheritance hierarchy, to
...
solve a crash in -instcombine -debug that was hit while investigating PR1217
llvm-svn: 34544
2007-02-24 00:55:48 +00:00
Devang Patel
06b8983669
Loop passes are set up to accept pointer.
...
llvm-svn: 34527
2007-02-23 17:53:17 +00:00
Evan Cheng
df6be7d4fc
Temporay hook to enable register scavening for specific targets only.
...
llvm-svn: 34513
2007-02-23 01:07:04 +00:00
Evan Cheng
387f1c2bdf
Use findRegisterUseOperand to find a kill of particular register.
...
llvm-svn: 34512
2007-02-23 01:04:26 +00:00
Evan Cheng
f9ef2bfd8a
Initial check in of register scavenger. Its only current functionality is tracking live registers per MBB.
...
llvm-svn: 34511
2007-02-23 01:01:19 +00:00
Devang Patel
46cad14ab8
Teach LoopPass to assign itself one Loop Pass Manager.
...
llvm-svn: 34510
2007-02-23 00:36:57 +00:00
Devang Patel
9a7b18fa3d
Add facility that allows LoopPass to re-insert a loop into
...
Loop Pass Manager's queue.
llvm-svn: 34509
2007-02-23 00:16:44 +00:00