1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
Commit Graph

5279 Commits

Author SHA1 Message Date
Owen Anderson
b371956400 Tabs -> Spaces
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson
ea857029ea Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
constructing ImmediateDominator is now folded into DomTree construction.

This is part of the ongoing work for PR217.

llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
41582c8198 Make ETForest depend on DomTree rather than IDom. This is the first step
in the long process that will be fixing PR 217.

llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Jeff Cohen
5a502fb622 Fix PR1329.
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Chris Lattner
5ed58fc4a9 add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
Writing it twice in the same day was too much for me.

llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Reid Spencer
6e7854339e Implement a getBitsNeeded method to determine how many bits are needed to
represent a string in binary form by an APInt.

llvm-svn: 35968
2007-04-13 19:19:07 +00:00
Dan Gohman
2d4b1767ab Rename Value::getValueType to getValueID, to avoid confusion with
other things named getValueType.

llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner
335f1cb1f8 CSE simple binary expressions when they are inserted. This makes LSR produce
less huge code that needs to be cleaned up by sdisel.

llvm-svn: 35959
2007-04-13 05:04:18 +00:00
Lauro Ramos Venancio
a76c2806de Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
82da0eb67c For PR1284:
Implement the "part_set" intrinsic.

llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Chris Lattner
9564abbfb5 improve the patch for PR1318 to also support grouped options with custom
handlers (like the pass list).  My previous fix only supported *new* command
line options, not additions to old ones.

This fixes test/Feature/load_module.ll

llvm-svn: 35935
2007-04-12 00:36:29 +00:00
Reid Spencer
2792e203c5 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
caf5a6cbd7 Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.

llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Bill Wendling
3b1189afbf Add support for our first SSSE3 instruction "pmulhrsw".
llvm-svn: 35869
2007-04-10 22:10:25 +00:00
Chris Lattner
5af0826c0b fix a comment bug Reid noticed
llvm-svn: 35864
2007-04-10 16:33:06 +00:00
Chris Lattner
f661523670 add missing methods, mark stuff const
llvm-svn: 35862
2007-04-10 07:06:21 +00:00
Chris Lattner
da0e61ca4c getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
llvm-svn: 35861
2007-04-10 06:44:12 +00:00
Chris Lattner
9359e7f928 add a method
llvm-svn: 35860
2007-04-10 06:43:18 +00:00
Reid Spencer
85e4416d26 Drop the "bit" prefix for the part.select intrinsic.
llvm-svn: 35854
2007-04-10 02:52:46 +00:00
Chris Lattner
461f7ed33b remove dead target hooks.
llvm-svn: 35847
2007-04-09 23:34:08 +00:00
Chris Lattner
ae6e2c0ee5 remove some dead target hooks, subsumed by isLegalAddressingMode
llvm-svn: 35840
2007-04-09 22:27:04 +00:00
Chris Lattner
b31e6eee0c add a default ctor for AddrMode.
llvm-svn: 35832
2007-04-09 21:18:34 +00:00
Reid Spencer
93a57ef458 For PR1146:
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.

llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
d2380cfb76 For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp

llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Anton Korobeynikov
6ee97ee42a Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.

llvm-svn: 35816
2007-04-09 12:31:58 +00:00
Reid Spencer
a617889460 For PR1146:
Remove the handling of ParameterAttributes from FunctionType as they are
their own object defined in ParameterAttributes.h now.

llvm-svn: 35805
2007-04-09 06:06:57 +00:00
Owen Anderson
e4c29f0b01 Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Reid Spencer
135f2f1261 Chris convinced me that the default size of the SmallVector (2) was too
small.  Since it doesn't cost much to have 2 more (8 bytes), but not having
them would require a malloc as soon as the third one is needed. Setting
the default to 4 delays the malloc until the 5th parameter attribute.

llvm-svn: 35793
2007-04-09 01:53:54 +00:00
Reid Spencer
4ea619ae00 Remove redundancy.
llvm-svn: 35790
2007-04-09 01:26:02 +00:00
Owen Anderson
f9a432a613 Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.

llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Reid Spencer
52e3bd1df0 Fix a typo.
llvm-svn: 35781
2007-04-08 22:50:29 +00:00
Reid Spencer
bcb7b5ca5d Implement more feedback:
* Allow attributes to be added and removed singly or jointly so that in
  the future something like -pruneh can manipulate them more easily.
* Move functions generally only useful for LLVM internals to the end of
  the accessors list instead of the beginning.

llvm-svn: 35780
2007-04-08 22:30:27 +00:00
Reid Spencer
065db06580 Implement review feedback.
llvm-svn: 35777
2007-04-08 22:05:44 +00:00
Owen Anderson
4b323657b9 Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer
e62f16d5c6 Implement the output inserter for PathWithStatus
llvm-svn: 35770
2007-04-08 20:05:10 +00:00
Reid Spencer
8b99493ea3 For PR1146:
New header file to provide parameter attribute declarations.

llvm-svn: 35767
2007-04-08 14:46:50 +00:00
Reid Spencer
aad3d1f6c8 For PR1291:
Change to use PathWithStatus

llvm-svn: 35746
2007-04-07 19:50:21 +00:00
Reid Spencer
14fb379888 For PR1291:
Implement the PathWithStatus class and its use throughout lib/System.

llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Owen Anderson
7cf9d12f2e Add DomSet back, and revert the changes to LoopSimplify. Apparently the
ETForest updating mechanisms don't work as I thought they did.  These changes
will be reapplied once the issue is worked out.

llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Nick Lewycky
ec51e934ef Add signExtend to ConstantRange, to complement zeroExtend and truncate.
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson
85b0e20f2a Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
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
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