Commit Graph

1936 Commits

Author SHA1 Message Date
Reid Spencer
532d0ce208 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 23:54:03 +00:00
Chris Lattner
00f23ec5c2 reapply my previous patch with a bugfix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 05:02:39 +00:00
Chris Lattner
e2c2b76c8a revert my previous change, something strange is happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 04:43:19 +00:00
Chris Lattner
1cf5574636 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 21:06:13 +00:00
Chris Lattner
3f3098c8ca disable some noisy debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 20:42:59 +00:00
Chris Lattner
6b178a3801 Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34548 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 01:19:50 +00:00
Chris Lattner
910c80a075 Refactor the setName stuff, moving it down the inheritance hierarchy, to
solve a crash in -instcombine -debug that was hit while investigating PR1217


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 00:55:48 +00:00
Evan Cheng
e811636f33 This cast broke lots of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 21:30:56 +00:00
Chris Lattner
9b4ee0c1bd switch ConstantFP's from ValueMap to DenseMap, which is much faster to query
and is more memory efficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 07:17:17 +00:00
Chris Lattner
6b6f6ba66c cleanup ConstantInt to use a single DenseMap for uniquing instead of the
heavy-weight ValueMap class.  This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 06:39:57 +00:00
Chris Lattner
d1afbd02ef Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 06:11:36 +00:00
Chris Lattner
eb41bddfdf Clean up the internals of the ConstantInt machinery
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34441 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 05:55:46 +00:00
Chris Lattner
e0e769607c simplify some code that was not llvm_shutdown safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34440 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 05:46:39 +00:00
Chris Lattner
f00c6add97 remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 05:29:47 +00:00
Chris Lattner
f9021ff740 llvm-gcc issue fixed, revert reversal :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 20:01:23 +00:00
Chris Lattner
da304d0750 remove warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34424 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 19:46:17 +00:00
Evan Cheng
e02e5e465b Temporarily reverting the patch. It's breaking llvm-gcc build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 19:23:41 +00:00
Reid Spencer
c552ff2825 Add a FIXME for unwritten code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34422 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 19:00:29 +00:00
Chris Lattner
32980699c0 remove dead methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 07:44:24 +00:00
Chris Lattner
63925c831a temporarily revert Devang's most recent patch, which caused a large
compile-time regression in LLC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 23:14:24 +00:00
Devang Patel
62b20023eb Use inverted map to speedup collectLastUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34364 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 03:53:44 +00:00
Andrew Lenharth
fadb3f773e fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34339 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-16 02:25:55 +00:00
Chris Lattner
bb5493d9fa make mayWriteToMemory a non-virtual function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34334 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 23:15:00 +00:00
Chris Lattner
0878c31059 rewrite Value::takeName to take advantage of the new symtab stuff. This
causes it to require no allocations and no symtab lookups in the common
case.  This speeds up instcombine 9.2% on 447.dealII.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34324 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 20:01:43 +00:00
Chris Lattner
3b515802f6 Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34318 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 19:17:16 +00:00
Chris Lattner
924b1ca9ee Add a new Value::getNameStr method, which is preferred over getName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34310 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 18:53:54 +00:00
Reid Spencer
ac9dcb94dd For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:39:18 +00:00
Reid Spencer
a85210ac66 For PR1195:
Change a comment: Packed Type -> Vector Type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:11:50 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
c38fea8ef4 better support for i128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34258 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 23:57:55 +00:00
Chris Lattner
f00042a999 Switch UnaryOperators to default to passing names up by const char* when possible.
This speeds up bcreading by 1.5%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 07:54:42 +00:00
Chris Lattner
ec79b3da13 add a setName variant that takes a null-terminated string. This can be
used to avoid std::string allocations in common cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34232 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 07:53:34 +00:00
Chris Lattner
133bab0606 eliminate instruction ctors that take vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 06:22:32 +00:00
Chris Lattner
d2dd1508aa Add invokeinst and callinst ctors that don't take vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 01:04:01 +00:00
Chris Lattner
d54f432006 remove some dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 00:58:44 +00:00
Chris Lattner
042ad36871 Add new setName accessor which doesn't require creating a string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 18:52:59 +00:00
Chris Lattner
dec628eead Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 05:18:08 +00:00
Chris Lattner
ea7acb8591 fix uninitialized variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 19:12:18 +00:00
Chris Lattner
f41916e75d add an optimization for the case where the src has no name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 01:04:09 +00:00
Chris Lattner
7216811ea2 add a helper method: Value::takeName
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 00:37:27 +00:00
Reid Spencer
cc5dc2e792 Assert that elements of packed are pointer/float/opaque.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34165 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 22:02:45 +00:00
Reid Spencer
e463fc8098 Allow PackedType to be constructed with an abstract type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 19:03:01 +00:00
Chris Lattner
f8edb62e22 convert some vectors to smallvector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 08:33:11 +00:00
Chris Lattner
8552faeb7e speed up the verifier 8.5% by using a smallvector instead of vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 08:30:29 +00:00
Chris Lattner
78287b400a Change an std::set to a SmallPtrSet. This speeds up the verifier on
447.dealII from 1.27s to 0.86s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 08:19:44 +00:00
Chris Lattner
d1f711fa6d Fix clients like this:
delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);
  llvm_shutdown();
  delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);

The primitive type objects failed to ressurect themselves after shutdown, leading
to crashes in clients that used them after llvm_shutdown().

This solution isn't wonderful, because we clearly have static ctors.  However,
the code it replaces was just as bad, so it's not a regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 22:24:04 +00:00
Jim Laskey
95af592a63 Automatically generating intrinsic declarations from Dan Gohman. Modified
to construct FunctionType in separate function, and, have getDeclaration
return a Function instead of a Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34008 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 20:38:26 +00:00
Devang Patel
f5e28d9dfe Do not drop transferred last uses on the floor.
Use handleLastUserOverflow().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 19:37:53 +00:00
Chris Lattner
92f5b6a784 constants can't be in the symtab anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33993 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:28:48 +00:00
Chris Lattner
b4d8d62345 update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:25:36 +00:00
Chris Lattner
7f1444bc0a shrink vmcore by moving symbol table stripping support out of VMCore into
the one IPO pass that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33990 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:22:45 +00:00
Chris Lattner
56920a0ecc eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
Make insert/remove assert if used incorrectly instead of returning a bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33988 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:13:49 +00:00
Chris Lattner
421d3daa05 speed up conflict handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:52:51 +00:00
Chris Lattner
58f84d4b2d Eliminate the O(n) version of TypeSymbolTable::remove, it is dead. When
inserting a type into the type symbol table, only compute unique name if not
in symtab already.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:35:58 +00:00
Chris Lattner
67408dab1b TypeSymbolTable::rename is dead, remove it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:29:34 +00:00
Chris Lattner
f5111552c2 Eliminate a bunch of work from ValueSymbolTable::insert for the common case
where a symbol name doesn't conflict.  This speeds up bc reading 16% on 176.gcc!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:22:49 +00:00
Jim Laskey
ba4cc09f51 Support var arg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33962 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 18:02:54 +00:00
Chris Lattner
775bd83050 Fix Transforms/ConstProp/2007-02-05-BitCast.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33948 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 02:22:56 +00:00
Reid Spencer
554cec6e65 A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33942 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 23:47:56 +00:00
Reid Spencer
688b0490e2 For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 21:19:13 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Devang Patel
90f1ad7bf4 Fix PR1158
Do not insert Analysis pass, if it is already available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 19:34:17 +00:00
Reid Spencer
6734b57d1b For PR1163:
Make the Module's dependent library use a std::vector instead of SetVector
adjust #includes in .cpp files because SetVector.h is no longer included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 00:40:42 +00:00
Reid Spencer
ebe57e36df Fix a comment that needed to change after SHIFT patch landed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 13:54:55 +00:00
Reid Spencer
832254e1c2 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Devang Patel
e27ae7e44e cvs commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 22:08:25 +00:00
Chris Lattner
2e21fce987 silence some warnings when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 04:59:37 +00:00
Reid Spencer
92905d95a0 Fix build breakage by using correct arguments to getIndexedType in the
GEP constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 22:30:26 +00:00
Chris Lattner
6ffbe17b3c implement the new GEP instruction ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 19:47:18 +00:00
Chris Lattner
2b9a5daf7c Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:40:28 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Devang Patel
c874eb54ec - Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).

- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager

- Use these two APIs in CalLgraphPassManager to measure timings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33638 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 23:10:37 +00:00
Devang Patel
b05ef6a8eb Move TimingInfo into PassManagers.h so that other libs can use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 20:06:26 +00:00
Anton Korobeynikov
b10308e440 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 13:31:35 +00:00
Jim Laskey
44c3b9fdd4 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 21:22:28 +00:00
Reid Spencer
f00c595bf5 For PR761:
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33527 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:07:57 +00:00
Reid Spencer
3702d265b8 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33523 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:02:52 +00:00
Reid Spencer
0fc052c36f For PR645:
Remove the Function::renameLocalSymbols function as it is no longer
needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33522 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:01:30 +00:00
Reid Spencer
43276ee280 IntegerType is a sized DerivedType too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33521 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 07:51:36 +00:00
Reid Spencer
3d10b0b2d3 Clean up comments and assert messages that still refer to the old type names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 07:37:34 +00:00
Reid Spencer
ca01cfe4df Fix an assertion message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33519 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 06:30:34 +00:00
Reid Spencer
2c7123c558 Whoops, fix typo in last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33417 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-21 02:29:10 +00:00
Reid Spencer
24d6da5fed For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-21 00:29:26 +00:00
Chris Lattner
58092e35a3 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 22:35:55 +00:00
Reid Spencer
ab60be7a00 Remove dead methods in the ValTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:25:12 +00:00
Reid Spencer
c10305743c For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:13:56 +00:00
Reid Spencer
b5f378e11b Use a cheaper computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 18:14:49 +00:00
Reid Spencer
7808dcba05 Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33328 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:59:54 +00:00
Devang Patel
44b0d29802 Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 21:19:23 +00:00
Devang Patel
26426949f3 s/PassDebugging_New/PassDebugging/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:33:36 +00:00
Devang Patel
be1ffc6b8d Update assignPassManager() signature to allow selection of preferred
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:30:17 +00:00
Reid Spencer
0a11af1f73 For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33282 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:46:11 +00:00
Devang Patel
8df87095fc Pass manager may require certain analysis. In such cases, initially
pass manager is last user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 22:38:10 +00:00
Devang Patel
9d133e150f Undo last check-in.
Remove setupPassManager() and its use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 21:43:18 +00:00
Devang Patel
531f01f878 Setup pass manager before scheduling required analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 19:46:09 +00:00
Devang Patel
8f3f3d103a Code refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33245 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 02:00:38 +00:00
Devang Patel
66eeb49d8f Remove extra white spaces. Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 23:06:56 +00:00
Devang Patel
3f5ecd7eb5 Do not record last users of Pass Manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33243 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 20:31:54 +00:00
Chris Lattner
9a40c023cc make this more efficient in release builds (time and space)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33239 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 18:28:18 +00:00
Chris Lattner
42a7551725 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Chris Lattner
b9d8b97f4a teach VMCore to accept i1 add's and shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:05:34 +00:00
Chris Lattner
bbd528d832 don't discriminate against i1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 00:45:50 +00:00
Reid Spencer
a1fed2d1c0 Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 01:09:33 +00:00
Reid Spencer
062f0360ed Make sure the IntegerValType has enough space for 2^23 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:12:29 +00:00
Jim Laskey
fa30182eb8 Allow isAllOnesValue testing on packed constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:39:14 +00:00
Devang Patel
e24e0e1244 s/addPassToManager/add/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33138 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
7f70559bc4 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:20:47 +00:00
Devang Patel
ab7752c149 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33135 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:52:44 +00:00
Chris Lattner
d333d90673 Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33134 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:42:52 +00:00
Devang Patel
a0dd987916 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 17:23:48 +00:00
Reid Spencer
15ee935fc5 Always write 1 bit integers as i1 not "bool".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:25:20 +00:00
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
579dca12c2 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 04:24:46 +00:00
Devang Patel
36bcb82c3f Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 22:15:30 +00:00
Devang Patel
6b9420e943 Use getPassManagerType() instead of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 19:59:06 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Reid Spencer
11b910c71f Shut up a warning about signed/unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 07:58:19 +00:00
Chris Lattner
ac618e6a9d simplify some logic further
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 04:30:21 +00:00
Chris Lattner
22379bc7bb Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 03:54:27 +00:00
Devang Patel
25919cb780 Add PassManagerType enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 01:10:25 +00:00
Reid Spencer
5305478511 Implement better constant folding of unordered FCMP predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:25:45 +00:00
Devang Patel
97149737f2 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:19:00 +00:00
Reid Spencer
162b02e327 Back out the last patch which is a nightly test killer. The assertion
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 09:18:16 +00:00
Chris Lattner
b2b442f06d Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 07:01:46 +00:00
Chris Lattner
55e73a5493 eliminate some iterator gymnastics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33052 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 06:43:26 +00:00
Chris Lattner
cf8790aaff Inline insertValue into CreateModuleSlot/CreateFunctionSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 08:04:59 +00:00
Chris Lattner
22990aae5c Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:58:11 +00:00
Chris Lattner
9446bbe7d4 Split CreateSlot into two versions, one for globals and one for function-local
values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:55:49 +00:00
Chris Lattner
3a4621c5f6 Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:46:21 +00:00
Reid Spencer
877e7ce051 Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:41:01 +00:00
Devang Patel
09e6e4303f Add PMStack, a Pass Manager stack.
Eventually, Top level pass managers  will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33018 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:29:38 +00:00
Andrew Lenharth
43f344a266 And asm writing for packed struct initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 18:21:30 +00:00
Chris Lattner
70d130516a Change the interface to Module::getOrInsertFunction to be easier to use,
to resolve PR1088, and to help PR411.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32988 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:09:25 +00:00
Reid Spencer
78d033e086 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 07:24:44 +00:00
Devang Patel
cde53d3c1e 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 22:47:07 +00:00
Devang Patel
ddbc606e94 Remove PassManagerT.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32928 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 20:21:13 +00:00
Devang Patel
cccd80dfa3 Remove old pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 20:16:23 +00:00
Reid Spencer
2c261789d3 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 17:06:19 +00:00
Reid Spencer
affaf07bf8 Do not allow packed types for icmp and fcmp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 05:22:18 +00:00
Chris Lattner
70d8d121ea Now that setcondinst has been eliminated, we can mark Value::SubclassID
const and remove the ugly mutator methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32860 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 02:15:37 +00:00
Chris Lattner
898b2d52f9 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 02:13:20 +00:00
Chris Lattner
e94d8b2f53 fix some bugs handling vectors, avoid host-specific handling of undefined shift results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 01:56:39 +00:00
Chris Lattner
58513aa1c2 Add a new ConstantPacked::getAllOnesValue method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 01:49:26 +00:00
Reid Spencer
6359618e43 Fix a cut-and-paste bug for processing of InvokeInst parameter attributes.
The lookup of parameter attributes was offset by two because of the
additional operands in an invoke instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32801 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 22:17:01 +00:00
Reid Spencer
cc615c38b1 Fix a bug in comparison of GEP indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32798 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 21:43:30 +00:00
Reid Spencer
1fd79b8c42 Fix a bug in getParamAttrs where an invalid value would be returned if the
index passed in was out of range for the number of parameter attributes set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32794 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 17:50:33 +00:00
Reid Spencer
79e21d338c For PR950:
Change signed integer type names to unsigned equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32780 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:26:44 +00:00
Reid Spencer
9c2e86a8d0 For PR950:
Implement signless integer types and FunctionType parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:25:34 +00:00
Reid Spencer
bd5db8e29b For PR950:
* Change integer type name from signed to signless
* Implement printing of FunctionType parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32778 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:24:50 +00:00
Reid Spencer
b951bc0283 For PR950:
Remove all grammar conflicts from assembly parsing.  This change involves:
1. Making the "type" keyword not a primitive type (removes several
   reduce/reduce conflicts)
2. Being more specific about which linkage types are allowed for functions
   and global variables. In particular "appending" can no longer be
   specified for a function. A differentiation was made between the various
   internal and external linkage types.
3. Introduced the "define" keyword which is now required when defining a
   function. This disambiguates several cases where a named function return
   type could get confused with the definition of a new type. Using the
   keyword eliminates all shift/reduce conflicts and the remaining
   reduce/reduce conflicts.

These changes are necessary to implement the function parameter attributes
that will be introduced soon. Adding the function parameter attributes in
the presence of the shift/reduce and reduce/reduce conflicts led to severe
ambiguities that caused the parser to report syntax errors that needed to
be resolved. This patch resolves them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-29 20:29:48 +00:00
Reid Spencer
b913bbaa41 Cleanup ConstantFoldCompareInstruction:
1. Make the arguments const like the other ConstantFold* functions.
2. Clean up evaluateFCmpRelation so it makes sense for floating point.
3. Implement the use of evaluateFCmpRelation to fold floating point CEs
4. Shorten a variable name so more things fit on one line.
5. Fix various comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-24 18:52:08 +00:00
Reid Spencer
4fa021a1a9 Fix some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-24 18:42:29 +00:00
Reid Spencer
283e20708b Don't overload var names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32752 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 10:21:26 +00:00
Reid Spencer
e4d87aa2de For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Devang Patel
c7d0f4be88 ModulePass and ImmutablePass. Force out of line virtual method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-22 22:49:00 +00:00
Devang Patel
1336a6bf06 At the beginning of run, initialize analyis info availability for _ALL_
pass managers. Otherwise, stale available analysis info, from the managers not
yet run, may cause pass manager to take wrong turn.

This fixes CBE test failures reported by nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 00:16:50 +00:00
Chris Lattner
62d75e7695 Fix Regression/Verifier/invoke-1.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-20 21:20:13 +00:00
Chris Lattner
19591b3aaf Revert the previous patch which was incorrect. This unbreaks eon, but rebreaks
invoke-1.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32718 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-20 19:50:15 +00:00
Reid Spencer
9d908e8ca0 Now that ConstantInt::isValueValidForType can handle signed and unsigned
values regardless of the signedness of the constant's type, it is okay to
always make the AsmWriter.cpp print constant ints as signed values. The
AsmParser will automatically handle things like: uint -1 as a result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32686 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 21:16:35 +00:00
Devang Patel
a68941b2d4 Now, there is additional layer, referred in the comment,
in place to handle this correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 20:12:38 +00:00
Devang Patel
5f4ddf517f s/BasicBlockPassManager/BBPassManager/g
s/ModulePassManager/MPPassManager/g
s/FunctionPassManagerImpl_New/FunctionPassManagerImpl/g
s/PassManagerImpl_New/PassManagerImpl/g

Introduce FPPassManager to manage function passes and
BBPassManagers.

Now FunctionPassManagerImpl is an implementation class
used by externally visible FunctionPassManager to manage
FPPassManagers.

Module pass manager (MPPassManager) now manages FPPassManagers
and ModulePasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32679 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 19:46:59 +00:00
Reid Spencer
85e36e474d Clean up ConstantFoldCastInstruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 07:41:40 +00:00
Reid Spencer
390437fc6d Rewrite ConstantFoldCastInstruction so that it doesn't use any of the
ConstRules. Remove the casting rules from ConstRules and subclasses. This
cleans up ConstantFolding significantly. Passes all tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32671 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 03:15:47 +00:00
Reid Spencer
9b11d518ae Make ConstantInt not care about sign any more. To ensure the AsmParser can
still check the validity of signed values an overload to isValueValidForType
was added to allow passing in an int64_t to check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32663 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 01:28:19 +00:00
Reid Spencer
c597a888c0 Remove a useless statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 23:40:19 +00:00
Reid Spencer
d71b620c6c For PR1042:
Fix a thinko. We want to check the second case if the first cast *didn't*
trigger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32657 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 21:56:29 +00:00
Reid Spencer
1bd82a5c65 Remove the createInferredCast methods now that their last uses have been
removed. All casting is now explicit and not inferred by VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32655 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 08:52:59 +00:00
Reid Spencer
d97321ceb3 Remove the two-argument (inferred cast) form of ConstantExpr::getCast now
that its last uses have been removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32653 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 08:18:46 +00:00
Reid Spencer
fdf15e1dc8 Revert last patch. ConstantInt isn't quite ready for signlessness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32650 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 04:22:56 +00:00
Reid Spencer
d54d8fa45a Remove the last use of getUnsignedVersion and getSignedVersion from VMCore.
ConstantInt doesn't care about the sign of the type it represents. It only
cares about the bitwidth so there is no need to make the sign of the type
match the SExt or ZExt constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32646 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 01:11:03 +00:00
Chris Lattner
e3cbe03d13 Fix PR1042, by tightening up the subtle rules with invoke value use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32624 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:25:35 +00:00
Devang Patel
1554c85456 Add getNumContainedPasses() and getContainedPass() inteface and use
it instead of passVectorBegin/End().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32620 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 00:56:26 +00:00
Devang Patel
1a8038636c Cosmetic changes, based on Chris's review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 22:57:49 +00:00
Jeff Cohen
6ebe23584e Partial unbreak of VC++ (stream stuff has no easy fix).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32614 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 21:47:01 +00:00
Devang Patel
a52035a062 Mark dump* routines const routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 20:13:01 +00:00
Devang Patel
c2ff962bf9 Move PMTopLevelManager and TImingInfo into anon namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 19:39:30 +00:00
Devang Patel
ef89c5594a s/ForcedLastUses/TransferLastUses/g
Register pass has the its last user, otherwise sometimes no one will claim
LastUse.

Handle transferred last uses from child pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32589 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 00:08:26 +00:00
Chris Lattner
a84b3025ca random minor typographical changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32579 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 18:22:14 +00:00
Devang Patel
8e58a1b17b Add -time-passes support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:59:42 +00:00
Devang Patel
017b5d969b Add debug-pass=Details support to print Required and Preserved Set info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:25:06 +00:00
Devang Patel
693a74e4ee Add " Made Modification " messages in debug-pass=Executions output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32572 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 00:08:04 +00:00
Devang Patel
4eeea774ce Add debug-pass=Executions support in new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 23:50:44 +00:00
Devang Patel
c32cf54101 Add -pass-debug=Arguments support in new manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32567 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 22:10:00 +00:00
Chris Lattner
6e9e5e026a fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32563 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 21:56:10 +00:00
Devang Patel
e8ff1ce734 Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32562 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 21:13:31 +00:00
Devang Patel
45dc02d6f9 Move enum PassDebugLevel from PassManagerT.h to Pass.h.
Use PDL as the prefix for these enums.
Define and use PassDebugging_New in new PassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32554 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 20:03:48 +00:00
Jim Laskey
5fed164d70 Update version in safe guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32546 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 17:49:24 +00:00
Chris Lattner
4d17caadbc only check non-external functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32530 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 04:45:46 +00:00
Chris Lattner
41af719526 Reject attempts to define intrinsics. This fixes PR1047 and
Regression/Verifier/2006-12-12-IntrinsicDefine.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 04:30:37 +00:00
Devang Patel
3162691f69 Add #ifdef switch toggle between old and new pass manager. However,
continue to use old pass manager at the moment. To use new manager
remove #define USE_OLD_PASSMANAGER 1 from Pass.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32525 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 02:36:01 +00:00
Devang Patel
2db3a3bed7 FunctionPassManager does not support runOnModule().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:34:32 +00:00
Devang Patel
37a6f7966c Implement PassManager_New destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:09:23 +00:00
Devang Patel
d4ea4ef541 Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32516 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:51:31 +00:00
Reid Spencer
d977d8651a Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:36:14 +00:00
Devang Patel
ebc0922eeb Add routines to dump pass manager queue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:34:33 +00:00
Devang Patel
b920bd85ad FunctionPassManager()
Set AnalysisResolver_New and add FPM to PassManagers list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:27:37 +00:00
Devang Patel
1fbe2c9964 Do not runOnFunction on external functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:15:28 +00:00
Devang Patel
41545fd663 Initialize AnalysisImpls for each pass before executing the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:13:09 +00:00
Devang Patel
27aaab2bd3 collectRequiredAnalysisPasses().
Include RequiredTrainsitiveSet also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:09:32 +00:00