Commit Graph

1983 Commits

Author SHA1 Message Date
Owen Anderson 6978893a8f Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Owen Anderson fe507270ac Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Nick Lewycky 73ffedb592 Don't crash when encountering a BasicBlock that hasn't been registered yet.
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Owen Anderson f7ebea1b9f 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
Owen Anderson 8763ba1b88 Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Reid Spencer 8d529a18f4 For PR1209:
Implement Type class's ContainedTys without using a std::vector.

llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Reid Spencer cce90f55ed Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer 2a2117c82d For PR1297:
Implement "actual" argument types for the Intrinsic member functions. This
involves changing the getName, getType, and getDeclaration methods to have
optional parameters for the actual types. These are necessary in order for
the type/name to be constructed properly for overloaded intrinsics. Only
the caller knows the actual argument types desired.

llvm-svn: 35541
2007-04-01 07:25:33 +00:00
Reid Spencer 7c57b88b27 For PR1297:
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
   type actually provided. ExpectedBits is the type expected for the
   intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
   suffix expected and making sure the suffix matches the function name. It
   also includes some intrinsic-specific checks such as ensuring that the
   bswap parameter and result are the same width and an even number of bytes.

llvm-svn: 35540
2007-04-01 07:22:57 +00:00
Chris Lattner 516f38b35f add a method to turn a type into a VT.
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Devang Patel 0b013d578d It is not possible to determine dominance between two PHI nodes
based on their ordering. This is applicable to ETForest::dominates() also.

llvm-svn: 35423
2007-03-28 14:57:43 +00:00
Reid Spencer 6d8e75ddb2 No need to generate the implementation keyword any more. Its frivolous.
llvm-svn: 35405
2007-03-28 01:53:20 +00:00
Devang Patel 5a1bd4045d Use SmallPtrSet.
llvm-svn: 35388
2007-03-27 20:50:46 +00:00
Devang Patel 2850c677af Spell check.
llvm-svn: 35374
2007-03-27 00:16:08 +00:00
Devang Patel bea581d70c It is not possible to determie dominance between two PHI nodes
based on their ordering.

llvm-svn: 35369
2007-03-26 23:18:28 +00:00
Devang Patel 55566a972c Use std::vector<DFCalculateWorkObject> instead of
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.

llvm-svn: 35368
2007-03-26 23:17:19 +00:00
Reid Spencer e20090b88d Add a comment to explain a folding transform.
llvm-svn: 35360
2007-03-26 20:09:02 +00:00
Chris Lattner 6d94bb79ac fold constantexprs more aggressively, fixing PR1265
llvm-svn: 35336
2007-03-25 05:47:04 +00:00
Chris Lattner 7750e344d3 add a valuetype for v1i64, which is needed by mmx.
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Reid Spencer d96dc9020a Fix constant fold of div by zero and rem by zero to match IEEE 754
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).

llvm-svn: 35277
2007-03-23 05:33:23 +00:00
Dan Gohman dcb291faa4 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer 478dcd0239 Add the NoUnwind function attribute.
llvm-svn: 35260
2007-03-22 02:14:48 +00:00
Devang Patel eb5d241d00 DominanceFrontier::calculate().
Avoid recursion, Use iterative algorithm.

llvm-svn: 35225
2007-03-20 21:25:31 +00:00
Devang Patel 1758cb50de LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

llvm-svn: 35221
2007-03-20 20:18:12 +00:00
Chris Lattner af867a3937 Fix a nasty memory leak, caused by my revamp of the value symbol table.
llvm-svn: 35195
2007-03-20 00:18:10 +00:00
Reid Spencer 362fb29d80 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 508167861d For PR1258:
Radically simplify the SlotMachine. There is no need to keep Value planes
around any more. This change causes slot numbering to number all un-named,
non-void values starting at 0 and incrementing monotonically through the
function, regardless of type (including BasicBlocks). Getting slot numbers
is now a single lookup operation instead of a double lookup.

llvm-svn: 35171
2007-03-19 18:32:53 +00:00
Devang Patel 01919d2c0b Speed Up Pass Manager.
- Check Immutableness before searching PreservedSet.
- Avoid unnecessary traversal while setting Last User.

llvm-svn: 35028
2007-03-08 19:05:01 +00:00
Evan Cheng f9e003b653 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
Devang Patel 9d9fc90952 Keep track of higher level analysis.
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel 42dd1e92c7 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 d74ede70fb 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
Devang Patel ec2b9a7850 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 003a559633 Avoid constructing std::strings unless pass debugging is ON.
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Devang Patel 7ebf09dbca Account for time consumed by releaseMemory() properly.
llvm-svn: 34932
2007-03-05 18:20:51 +00:00
Jeff Cohen b622c11f77 Unbreak VC++ build.
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Reid Spencer 50d7ad9183 Fix constant folding of fp->int bitcast for vectors.
llvm-svn: 34880
2007-03-03 08:32:46 +00:00
Reid Spencer 2e54a15943 Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.

llvm-svn: 34821
2007-03-02 00:28:52 +00:00
Reid Spencer 4326cf5c51 Use the APInt versions of the bit-wise conversions of float/double to int
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.

llvm-svn: 34808
2007-03-01 20:44:23 +00:00
Reid Spencer a9e6e31db6 Use modern variable name. ConstantUnsignedInt is long since dead. No
functional change with this patch.

llvm-svn: 34806
2007-03-01 20:27:41 +00:00
Reid Spencer a127633716 Use a simpler constructor when constructing ConstantInst.
llvm-svn: 34793
2007-03-01 19:31:12 +00:00
Reid Spencer d1bbfa5aa6 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 5a642a7991 Reduce #includage by taking a method out of line.
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Reid Spencer 0286bc1af5 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 8774fe816a 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 4aeaeaf894 Pull out the stops.
llvm-svn: 34703
2007-02-27 23:33:03 +00:00
Reid Spencer 3370b04a66 Remove some redundancy.
llvm-svn: 34702
2007-02-27 23:27:26 +00:00
Reid Spencer e2eb1fab8c Adjust to changes in the APInt interface.
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer ac419b52ad For PR1205:
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
   that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
   to the bitwidth.

llvm-svn: 34677
2007-02-27 19:29:54 +00:00
Devang Patel 28349abeab Make getPassManagerType() const.
llvm-svn: 34669
2007-02-27 15:00:39 +00:00
Reid Spencer ad25003200 Allow the AsmWriter to print out arbitrary precision integers.
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer a91ec25da0 Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
widths > 64 bits.

llvm-svn: 34663
2007-02-27 07:57:53 +00:00
Reid Spencer 81658a8aca For PR1205:
Implement constant folding via APInt instead of uint64_t.

llvm-svn: 34660
2007-02-27 06:23:51 +00:00
Chris Lattner 33e93b84af ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
lib/Analysis/ConstantFolding.

llvm-svn: 34653
2007-02-27 03:05:06 +00:00
Reid Spencer b31bffed96 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
Chris Lattner dd89d9c648 reapply my previous patch with a bugfix.
llvm-svn: 34627
2007-02-26 05:02:39 +00:00
Chris Lattner b5359f0994 revert my previous change, something strange is happening.
llvm-svn: 34626
2007-02-26 04:43:19 +00:00
Chris Lattner 76ac8f82bd 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
Chris Lattner b377a7ca11 disable some noisy debug output
llvm-svn: 34606
2007-02-25 20:42:59 +00:00
Chris Lattner fb94fe742b Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215
llvm-svn: 34548
2007-02-24 01:19:50 +00:00
Chris Lattner 2195fc41ec 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
Evan Cheng 71b8723f07 This cast broke lots of tests.
llvm-svn: 34457
2007-02-20 21:30:56 +00:00
Chris Lattner c6ee77d1b0 switch ConstantFP's from ValueMap to DenseMap, which is much faster to query
and is more memory efficient.

llvm-svn: 34446
2007-02-20 07:17:17 +00:00
Chris Lattner a80bf0b2a6 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!

llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner 281735098a Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner 5db2f47364 Clean up the internals of the ConstantInt machinery
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner dbcb0d3ffe simplify some code that was not llvm_shutdown safe
llvm-svn: 34440
2007-02-20 05:46:39 +00:00
Chris Lattner 62b2842b6f remove dead method
llvm-svn: 34436
2007-02-20 05:29:47 +00:00
Chris Lattner b5d703018b llvm-gcc issue fixed, revert reversal :)
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Chris Lattner 86358635e5 remove warning
llvm-svn: 34424
2007-02-19 19:46:17 +00:00
Evan Cheng 0a02f82767 Temporarily reverting the patch. It's breaking llvm-gcc build.
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
Reid Spencer 887ae70af5 Add a FIXME for unwritten code.
llvm-svn: 34422
2007-02-19 19:00:29 +00:00
Chris Lattner 4669b0bf54 remove dead methods
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner 9df8be40fe temporarily revert Devang's most recent patch, which caused a large
compile-time regression in LLC.

llvm-svn: 34385
2007-02-17 23:14:24 +00:00
Devang Patel 98354dabc1 Use inverted map to speedup collectLastUses().
llvm-svn: 34364
2007-02-17 03:53:44 +00:00
Andrew Lenharth 9d4819be08 fix build
llvm-svn: 34339
2007-02-16 02:25:55 +00:00
Chris Lattner c992e18f8d make mayWriteToMemory a non-virtual function
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Chris Lattner cf835ff85a 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.

llvm-svn: 34324
2007-02-15 20:01:43 +00:00
Chris Lattner 1e92e06779 Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.

llvm-svn: 34318
2007-02-15 19:17:16 +00:00
Chris Lattner fd27ed9733 Add a new Value::getNameStr method, which is preferred over getName.
llvm-svn: 34310
2007-02-15 18:53:54 +00:00
Reid Spencer 09575bac2e For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.

llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer d4a0b7bb7b For PR1195:
Change a comment: Packed Type -> Vector Type

llvm-svn: 34299
2007-02-15 03:11:50 +00:00
Reid Spencer d84d35ba70 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner 084c4ca591 better support for i128.
llvm-svn: 34258
2007-02-13 23:57:55 +00:00
Chris Lattner 0f04816cad Switch UnaryOperators to default to passing names up by const char* when possible.
This speeds up bcreading by 1.5%.

llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Chris Lattner cb9a626c67 add a setName variant that takes a null-terminated string. This can be
used to avoid std::string allocations in common cases.

llvm-svn: 34232
2007-02-13 07:53:34 +00:00
Chris Lattner e563e480d9 eliminate instruction ctors that take vectors.
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner b5fcc28075 Add invokeinst and callinst ctors that don't take vectors.
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner 054ba2c002 remove some dead methods.
llvm-svn: 34213
2007-02-13 00:58:44 +00:00
Chris Lattner 1a5de584dc Add new setName accessor which doesn't require creating a string.
llvm-svn: 34197
2007-02-12 18:52:59 +00:00
Chris Lattner 32ab643df7 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%.

llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Chris Lattner 569c8acfe3 fix uninitialized variable
llvm-svn: 34182
2007-02-11 19:12:18 +00:00
Chris Lattner cba18e3a01 add an optimization for the case where the src has no name
llvm-svn: 34174
2007-02-11 01:04:09 +00:00
Chris Lattner b625082a42 add a helper method: Value::takeName
llvm-svn: 34171
2007-02-11 00:37:27 +00:00
Reid Spencer d63a5200cb Assert that elements of packed are pointer/float/opaque.
llvm-svn: 34165
2007-02-10 22:02:45 +00:00
Reid Spencer 8a5e9891e8 Allow PackedType to be constructed with an abstract type.
llvm-svn: 34152
2007-02-10 19:03:01 +00:00
Chris Lattner 59a8d2c30f convert some vectors to smallvector.
llvm-svn: 34145
2007-02-10 08:33:11 +00:00
Chris Lattner 84d82c7e98 speed up the verifier 8.5% by using a smallvector instead of vector.
llvm-svn: 34144
2007-02-10 08:30:29 +00:00
Chris Lattner bc97cc29e7 Change an std::set to a SmallPtrSet. This speeds up the verifier on
447.dealII from 1.27s to 0.86s.

llvm-svn: 34143
2007-02-10 08:19:44 +00:00
Chris Lattner d2e8e55ae0 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.

llvm-svn: 34106
2007-02-09 22:24:04 +00:00
Jim Laskey 2682ea616f Automatically generating intrinsic declarations from Dan Gohman. Modified
to construct FunctionType in separate function, and, have getDeclaration
return a Function instead of a Constant.

llvm-svn: 34008
2007-02-07 20:38:26 +00:00
Devang Patel 4d06ace0ef Do not drop transferred last uses on the floor.
Use handleLastUserOverflow().

llvm-svn: 34006
2007-02-07 19:37:53 +00:00
Chris Lattner 86fc08145b constants can't be in the symtab anymore
llvm-svn: 33993
2007-02-07 06:28:48 +00:00
Chris Lattner d17dbe9dcd update comment.
llvm-svn: 33992
2007-02-07 06:25:36 +00:00
Chris Lattner 88051b0fad shrink vmcore by moving symbol table stripping support out of VMCore into
the one IPO pass that uses it.

llvm-svn: 33990
2007-02-07 06:22:45 +00:00
Chris Lattner f5df4859cd eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
Make insert/remove assert if used incorrectly instead of returning a bool.

llvm-svn: 33988
2007-02-07 06:13:49 +00:00
Chris Lattner 71a60ba41c speed up conflict handling.
llvm-svn: 33985
2007-02-07 05:52:51 +00:00
Chris Lattner c8d5207b85 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.

llvm-svn: 33983
2007-02-07 05:35:58 +00:00
Chris Lattner afd6f2f463 TypeSymbolTable::rename is dead, remove it
llvm-svn: 33982
2007-02-07 05:29:34 +00:00
Chris Lattner 770dadf308 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!

llvm-svn: 33981
2007-02-07 05:22:49 +00:00
Jim Laskey 5aed30d5cf Support var arg intrinsics.
llvm-svn: 33962
2007-02-06 18:02:54 +00:00
Chris Lattner e62c89a9f5 Fix Transforms/ConstProp/2007-02-05-BitCast.ll
llvm-svn: 33948
2007-02-06 02:22:56 +00:00
Reid Spencer d7a00d7414 A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits.
llvm-svn: 33942
2007-02-05 23:47:56 +00:00
Reid Spencer 1241d6d5ab For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)

llvm-svn: 33922
2007-02-05 21:19:13 +00:00
Reid Spencer 3aaaa0b2bd 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.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Devang Patel 3f806969ed Fix PR1158
Do not insert Analysis pass, if it is already available.

llvm-svn: 33915
2007-02-05 19:34:17 +00:00
Reid Spencer 3f4e6e84dc 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.

llvm-svn: 33855
2007-02-04 00:40:42 +00:00
Reid Spencer 0cdd04fa90 Fix a comment that needed to change after SHIFT patch landed.
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Reid Spencer 2341c22ec7 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.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Devang Patel e3858e6674 cvs commit
llvm-svn: 33765
2007-02-01 22:08:25 +00:00
Chris Lattner f14c76cf5d silence some warnings when assertions are disabled.
llvm-svn: 33747
2007-02-01 04:59:37 +00:00
Reid Spencer dee14b50e4 Fix build breakage by using correct arguments to getIndexedType in the
GEP constructors.

llvm-svn: 33726
2007-01-31 22:30:26 +00:00
Chris Lattner 79807c3dfe implement the new GEP instruction ctors.
llvm-svn: 33708
2007-01-31 19:47:18 +00:00
Chris Lattner 302116a5ec 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.

llvm-svn: 33692
2007-01-31 04:40:28 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Devang Patel 1c3633e461 - 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.

llvm-svn: 33638
2007-01-29 23:10:37 +00:00
Devang Patel 55bcb50840 Move TimingInfo into PassManagers.h so that other libs can use it.
llvm-svn: 33626
2007-01-29 20:06:26 +00:00
Anton Korobeynikov 037c867b54 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.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Jim Laskey c56315c2b5 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.

llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Reid Spencer 93b2d78121 For PR761:
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.

llvm-svn: 33527
2007-01-26 08:07:57 +00:00
Reid Spencer 788e317cd7 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.

llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Reid Spencer c4fbcb370b For PR645:
Remove the Function::renameLocalSymbols function as it is no longer
needed.

llvm-svn: 33522
2007-01-26 08:01:30 +00:00
Reid Spencer a760b7e1d3 IntegerType is a sized DerivedType too.
llvm-svn: 33521
2007-01-26 07:51:36 +00:00
Reid Spencer 2546b76054 Clean up comments and assert messages that still refer to the old type names.
llvm-svn: 33520
2007-01-26 07:37:34 +00:00
Reid Spencer 7e16e23df8 Fix an assertion message.
llvm-svn: 33519
2007-01-26 06:30:34 +00:00
Reid Spencer 6598ca8ab1 Whoops, fix typo in last commit.
llvm-svn: 33417
2007-01-21 02:29:10 +00:00
Reid Spencer 2eadb5310d For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Chris Lattner 50ee0e40e5 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Reid Spencer adf4118a36 Remove dead methods in the ValTypes.
llvm-svn: 33372
2007-01-19 21:25:12 +00:00
Reid Spencer a94d394ad2 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.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Reid Spencer f15cd5637b Use a cheaper computation.
llvm-svn: 33336
2007-01-18 18:14:49 +00:00
Reid Spencer 2867a1d466 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.

llvm-svn: 33328
2007-01-18 02:59:54 +00:00
Devang Patel 23f8aa921e Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.

llvm-svn: 33308
2007-01-17 21:19:23 +00:00
Devang Patel fd41843243 s/PassDebugging_New/PassDebugging/g
llvm-svn: 33307
2007-01-17 20:33:36 +00:00
Devang Patel dffca63396 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.

llvm-svn: 33306
2007-01-17 20:30:17 +00:00
Reid Spencer 00e5e0ea8f For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.

llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Devang Patel d85662f67d Pass manager may require certain analysis. In such cases, initially
pass manager is last user.

llvm-svn: 33273
2007-01-16 22:38:10 +00:00
Devang Patel 3312f75071 Undo last check-in.
Remove setupPassManager() and its use.

llvm-svn: 33270
2007-01-16 21:43:18 +00:00
Devang Patel 68dc3d2263 Setup pass manager before scheduling required analysis.
llvm-svn: 33262
2007-01-16 19:46:09 +00:00
Devang Patel 4268fc08d3 Code refactoring.
llvm-svn: 33245
2007-01-16 02:00:38 +00:00
Devang Patel 6975b6ec09 Remove extra white spaces. Fix comments.
llvm-svn: 33244
2007-01-15 23:06:56 +00:00
Devang Patel 39786a90d0 Do not record last users of Pass Manager.
llvm-svn: 33243
2007-01-15 20:31:54 +00:00
Chris Lattner 90d2e426f9 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner 03c4953cdd 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! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner 57eedaca52 teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Chris Lattner 885433b15b don't discriminate against i1
llvm-svn: 33213
2007-01-15 00:45:50 +00:00
Reid Spencer 91d93de25e Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
llvm-svn: 33176
2007-01-13 01:09:33 +00:00
Reid Spencer ea4374c0d4 Make sure the IntegerValType has enough space for 2^23 bits.
llvm-svn: 33168
2007-01-13 00:12:29 +00:00
Jim Laskey f047882b15 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Devang Patel f85793d171 s/addPassToManager/add/g
llvm-svn: 33138
2007-01-12 20:07:16 +00:00
Anton Korobeynikov a0554d90e8 * 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)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Devang Patel e759955c66 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.

llvm-svn: 33135
2007-01-12 18:52:44 +00:00
Chris Lattner 344da52c4c Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.

llvm-svn: 33134
2007-01-12 18:42:52 +00:00
Devang Patel 0f08004ac0 Remove dead code.
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer c87215900d Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Reid Spencer 7a9c62baa6 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.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer cddc9dfe97 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.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Devang Patel ad98d23f16 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.

llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Devang Patel ac99eca428 Use getPassManagerType() instead of dynamic_cast.
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng 75b871fb1e For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Reid Spencer 5656cad97d Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner 550a8f3760 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner 5e04332326 Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.

llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Devang Patel 3b3f89900e Add PassManagerType enum.
llvm-svn: 33065
2007-01-11 01:10:25 +00:00
Reid Spencer 74bd036059 Implement better constant folding of unordered FCMP predicates.
llvm-svn: 33063
2007-01-11 00:25:45 +00:00
Devang Patel 15701b5c0d Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.

llvm-svn: 33062
2007-01-11 00:19:00 +00:00
Reid Spencer c6c4fab067 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.

llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner 2d56715015 Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.

llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner 2cf85c7507 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Chris Lattner 04398e8d48 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner 721c213c0e Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!

llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner ea862a33d9 Split CreateSlot into two versions, one for globals and one for function-local
values

llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner 89e774efaa Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.

llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Reid Spencer 7254c25fad Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.

llvm-svn: 33020
2007-01-08 19:41:01 +00:00
Devang Patel 1c56a638a4 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.

llvm-svn: 33018
2007-01-08 19:29:38 +00:00
Andrew Lenharth 0d124b8e00 And asm writing for packed struct initializers
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Chris Lattner 505c06b739 Change the interface to Module::getOrInsertFunction to be easier to use,
to resolve PR1088, and to help PR411.

llvm-svn: 32988
2007-01-07 08:09:25 +00:00
Reid Spencer 32af9e8cc5 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.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Devang Patel b66334b73b 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver

llvm-svn: 32938
2007-01-05 22:47:07 +00:00
Devang Patel 20f9e22ae2 Remove PassManagerT.h
llvm-svn: 32928
2007-01-05 20:21:13 +00:00
Devang Patel c6b5a554a4 Remove old pass manager.
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Reid Spencer 136a91c4e7 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.

llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Reid Spencer 438f562e56 Do not allow packed types for icmp and fcmp instructions.
llvm-svn: 32865
2007-01-04 05:22:18 +00:00
Chris Lattner f96f4492e0 Now that setcondinst has been eliminated, we can mark Value::SubclassID
const and remove the ugly mutator methods.

llvm-svn: 32860
2007-01-04 02:15:37 +00:00
Chris Lattner 858f4e9362 fix typo
llvm-svn: 32859
2007-01-04 02:13:20 +00:00
Chris Lattner 26f13eb1f3 fix some bugs handling vectors, avoid host-specific handling of undefined shift results.
llvm-svn: 32857
2007-01-04 01:56:39 +00:00
Chris Lattner ecab54cfc0 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer 9cfa4e8459 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.

llvm-svn: 32801
2006-12-31 22:17:01 +00:00
Reid Spencer c90cf77367 Fix a bug in comparison of GEP indices.
llvm-svn: 32798
2006-12-31 21:43:30 +00:00
Reid Spencer 4e746749de 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.

llvm-svn: 32794
2006-12-31 17:50:33 +00:00
Reid Spencer 8d9336d065 For PR950:
Change signed integer type names to unsigned equivalents.

llvm-svn: 32780
2006-12-31 05:26:44 +00:00
Reid Spencer b82ea5354c For PR950:
Implement signless integer types and FunctionType parameter attributes.

llvm-svn: 32779
2006-12-31 05:25:34 +00:00
Reid Spencer 8c4914c1e3 For PR950:
* Change integer type name from signed to signless
* Implement printing of FunctionType parameter attributes.

llvm-svn: 32778
2006-12-31 05:24:50 +00:00
Reid Spencer 7ce2d2a8fe 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.

llvm-svn: 32770
2006-12-29 20:29:48 +00:00
Reid Spencer 9d36acf9ec 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.

llvm-svn: 32759
2006-12-24 18:52:08 +00:00
Reid Spencer b15374974d Fix some comments.
llvm-svn: 32758
2006-12-24 18:42:29 +00:00
Reid Spencer ccf78ac1d0 Don't overload var names.
llvm-svn: 32752
2006-12-23 10:21:26 +00:00
Reid Spencer 266e42b312 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.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Devang Patel f5a994e5cc ModulePass and ImmutablePass. Force out of line virtual method.
llvm-svn: 32748
2006-12-22 22:49:00 +00:00
Devang Patel e3068403bd 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.

llvm-svn: 32726
2006-12-21 00:16:50 +00:00
Chris Lattner 6fc3c7a8be Fix Regression/Verifier/invoke-1.ll
llvm-svn: 32722
2006-12-20 21:20:13 +00:00
Chris Lattner 439c25a08a Revert the previous patch which was incorrect. This unbreaks eon, but rebreaks
invoke-1.ll

llvm-svn: 32718
2006-12-20 19:50:15 +00:00
Reid Spencer 2acb8e1a43 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.

llvm-svn: 32686
2006-12-19 21:16:35 +00:00
Devang Patel cb5128a8d9 Now, there is additional layer, referred in the comment,
in place to handle this correctly.

llvm-svn: 32684
2006-12-19 20:12:38 +00:00
Devang Patel 67d6a5e411 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.

llvm-svn: 32679
2006-12-19 19:46:59 +00:00
Reid Spencer 8dabca4118 Clean up ConstantFoldCastInstruction.
llvm-svn: 32672
2006-12-19 07:41:40 +00:00
Reid Spencer f5fc34ad09 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.

llvm-svn: 32671
2006-12-19 03:15:47 +00:00
Reid Spencer e733472221 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.

llvm-svn: 32663
2006-12-19 01:28:19 +00:00
Reid Spencer 8b5cd5f710 Remove a useless statement.
llvm-svn: 32660
2006-12-18 23:40:19 +00:00
Reid Spencer 77cc7edf3e For PR1042:
Fix a thinko. We want to check the second case if the first cast *didn't*
trigger.

llvm-svn: 32657
2006-12-18 21:56:29 +00:00
Reid Spencer e45ac2ab11 Remove the createInferredCast methods now that their last uses have been
removed. All casting is now explicit and not inferred by VMCore.

llvm-svn: 32655
2006-12-18 08:52:59 +00:00
Reid Spencer 4800c38a75 Remove the two-argument (inferred cast) form of ConstantExpr::getCast now
that its last uses have been removed.

llvm-svn: 32653
2006-12-18 08:18:46 +00:00
Reid Spencer db6b6fb916 Revert last patch. ConstantInt isn't quite ready for signlessness.
llvm-svn: 32650
2006-12-18 04:22:56 +00:00
Reid Spencer 776311e000 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.

llvm-svn: 32646
2006-12-18 01:11:03 +00:00
Chris Lattner 697617709c Fix PR1042, by tightening up the subtle rules with invoke value use.
llvm-svn: 32624
2006-12-16 02:25:35 +00:00
Devang Patel abfbe3bfda Add getNumContainedPasses() and getContainedPass() inteface and use
it instead of passVectorBegin/End().

llvm-svn: 32620
2006-12-16 00:56:26 +00:00
Devang Patel 56d48ec501 Cosmetic changes, based on Chris's review.
llvm-svn: 32618
2006-12-15 22:57:49 +00:00
Jeff Cohen 9f46963f11 Partial unbreak of VC++ (stream stuff has no easy fix).
llvm-svn: 32614
2006-12-15 21:47:01 +00:00
Devang Patel 991aebacba Mark dump* routines const routines.
llvm-svn: 32610
2006-12-15 20:13:01 +00:00
Devang Patel ffca910d45 Move PMTopLevelManager and TImingInfo into anon namespace.
llvm-svn: 32606
2006-12-15 19:39:30 +00:00
Devang Patel 832bc079b2 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.

llvm-svn: 32589
2006-12-15 00:08:26 +00:00
Chris Lattner ce22ca3fc6 random minor typographical changes
llvm-svn: 32579
2006-12-14 18:22:14 +00:00
Devang Patel b8817b9b6e Add -time-passes support.
llvm-svn: 32574
2006-12-14 00:59:42 +00:00
Devang Patel f6d1d21355 Add debug-pass=Details support to print Required and Preserved Set info.
llvm-svn: 32573
2006-12-14 00:25:06 +00:00
Devang Patel 93a197c202 Add " Made Modification " messages in debug-pass=Executions output.
llvm-svn: 32572
2006-12-14 00:08:04 +00:00
Devang Patel 200d305c02 Add debug-pass=Executions support in new pass manager.
llvm-svn: 32571
2006-12-13 23:50:44 +00:00
Devang Patel cfd70c4a46 Add -pass-debug=Arguments support in new manager.
llvm-svn: 32567
2006-12-13 22:10:00 +00:00
Chris Lattner f0f611a76a fit in 80 cols
llvm-svn: 32563
2006-12-13 21:56:10 +00:00
Devang Patel 03fb587348 Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it.

llvm-svn: 32562
2006-12-13 21:13:31 +00:00
Devang Patel f1567a511f 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.

llvm-svn: 32554
2006-12-13 20:03:48 +00:00
Jim Laskey b6cdf465c2 Update version in safe guards.
llvm-svn: 32546
2006-12-13 17:49:24 +00:00
Chris Lattner cb813314aa only check non-external functions
llvm-svn: 32530
2006-12-13 04:45:46 +00:00
Chris Lattner 50a9951809 Reject attempts to define intrinsics. This fixes PR1047 and
Regression/Verifier/2006-12-12-IntrinsicDefine.ll

llvm-svn: 32529
2006-12-13 04:30:37 +00:00
Devang Patel b67904d1dc 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

llvm-svn: 32525
2006-12-13 02:36:01 +00:00
Devang Patel 08bed59d59 FunctionPassManager does not support runOnModule().
llvm-svn: 32519
2006-12-13 00:34:32 +00:00
Devang Patel ab97cf4c7c Implement PassManager_New destructors.
llvm-svn: 32517
2006-12-13 00:09:23 +00:00
Devang Patel 209b13990f Remove unused constructor.
llvm-svn: 32516
2006-12-12 23:51:31 +00:00
Reid Spencer bb65ebf9a1 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.

llvm-svn: 32514
2006-12-12 23:36:14 +00:00
Devang Patel eda561762f Add routines to dump pass manager queue.
llvm-svn: 32513
2006-12-12 23:34:33 +00:00
Devang Patel 1036b65ca0 FunctionPassManager()
Set AnalysisResolver_New and add FPM to PassManagers list.

llvm-svn: 32512
2006-12-12 23:27:37 +00:00
Devang Patel 745a696050 Do not runOnFunction on external functions.
llvm-svn: 32510
2006-12-12 23:15:28 +00:00
Devang Patel 47d7df7407 Initialize AnalysisImpls for each pass before executing the pass.
llvm-svn: 32509
2006-12-12 23:13:09 +00:00
Devang Patel f58183dae1 collectRequiredAnalysisPasses().
Include RequiredTrainsitiveSet also.

llvm-svn: 32508
2006-12-12 23:09:32 +00:00
Devang Patel be6bd55e96 removeNotPreservedAnalysis().
Do not remove ImmutablePass from the list.

llvm-svn: 32507
2006-12-12 23:07:44 +00:00
Devang Patel ad6b7fe726 Initialize activeManager.
llvm-svn: 32506
2006-12-12 22:57:43 +00:00
Devang Patel 5f945dd79e Remove unused constructor.
llvm-svn: 32505
2006-12-12 22:56:36 +00:00
Devang Patel 75cdf20412 Maintain ImmutablePasses list at top level only. Do not make them
directly available to individual managers.

llvm-svn: 32504
2006-12-12 22:53:40 +00:00
Devang Patel cd6ba15364 findAnalysisPass().
First search all available passes before searching ImmutablePasses.

llvm-svn: 32503
2006-12-12 22:50:05 +00:00
Devang Patel 10c2ca6874 Fix thinko.
While searching for a analysis in a pass manager, do not search it into
pass manager's manager.

llvm-svn: 32501
2006-12-12 22:47:13 +00:00
Devang Patel afb1f362c6 o s/OtherPassManagers/IndirectPassManagers
o Make IndirectPassManagers vector of PMDataManager *
o Move PMTopLevelManager implementation below all class declarations.

llvm-svn: 32499
2006-12-12 22:35:25 +00:00
Devang Patel 95257548c9 Initialize AnalysisImpls for ImmutablePass.
llvm-svn: 32498
2006-12-12 22:21:37 +00:00
Devang Patel 9c6290c53c Set top level manager.
llvm-svn: 32496
2006-12-12 22:02:16 +00:00
Reid Spencer ca104e80ee Don't create usless casts for same-bith-width floating point casts.
llvm-svn: 32475
2006-12-12 05:38:50 +00:00
Reid Spencer 56521c48fe Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
to the createIntegerCast and createFPCast for CastInst instructions.

llvm-svn: 32457
2006-12-12 00:51:07 +00:00
Reid Spencer 7e93347b57 Implement createIntegerCast and createFPCast factory methods for handling
integer and floating point cast creation. createIntegerCast generates
ZExt/SExt, BitCast or Trunc. createFPCast generates FPExt, Bitcast, or
FPTrunc.

llvm-svn: 32456
2006-12-12 00:49:44 +00:00
Reid Spencer 3db7d3764e Fix constant folding of FP->int due to cut & paste error in last commit.
llvm-svn: 32447
2006-12-11 21:27:28 +00:00
Chris Lattner 4d1da16ec1 Implement correct constant folding of bitcast. This implements
Transforms/ConstProp/bitcast.ll and fixes
SingleSource/Regression/C/2003-10-12-GlobalVarInitializers

llvm-svn: 32438
2006-12-11 18:30:27 +00:00
Chris Lattner 8410beb12d fix typo
llvm-svn: 32428
2006-12-11 02:16:58 +00:00
Chris Lattner ad796fadf7 fix PR1039 by making timing info be destroyed by llvm_shutdown, not by
static dtors.

llvm-svn: 32411
2006-12-10 07:40:46 +00:00
Devang Patel 984698ac24 Analysis resolver now manages AnalysisImpls for the given patch.
llvm-svn: 32389
2006-12-09 01:11:34 +00:00
Devang Patel 9d759b8854 Top level pass manager keeps track of other managers, so this can be
removed now.

llvm-svn: 32388
2006-12-09 00:09:12 +00:00
Devang Patel 64619bec14 Use analysis resolver to find the info.
llvm-svn: 32387
2006-12-09 00:07:38 +00:00
Devang Patel fa971cda8b Do not drop ImmutablePasses on the floor.
llvm-svn: 32386
2006-12-08 23:57:43 +00:00
Devang Patel d440cd92a5 Set AnalysisResolver for the passes when they are inserted into
pass manager queuer.

llvm-svn: 32385
2006-12-08 23:53:00 +00:00
Devang Patel 9bdf7d46f6 Add AnalysisResolver_New. It is a replacement for existing
AnalysisResolver.

llvm-svn: 32383
2006-12-08 23:28:54 +00:00
Devang Patel af1fca5f10 Keep track of other pass managers, that are not directly managed by
top level manager. Use this info to findAnalysisPass.

llvm-svn: 32382
2006-12-08 23:11:43 +00:00
Devang Patel 272908dcf2 Implement top level FunctionPassManager::run(Function &F)
llvm-svn: 32381
2006-12-08 22:57:48 +00:00
Devang Patel 5bbeb49130 Do not keep yet another list of pass managers in PassManagerImpl_New.
Use one provided by toplevel manager.

llvm-svn: 32380
2006-12-08 22:47:25 +00:00
Devang Patel df6c9ae208 Remove unused schedulePass() parameter.
llvm-svn: 32379
2006-12-08 22:34:02 +00:00
Devang Patel e31049fed5 Remove unused getAnalysisPass and getAnalysisPassFromManager
llvm-svn: 32378
2006-12-08 22:32:32 +00:00
Devang Patel 640c5bba77 Implement PMTopLevel::findAnalysisPass() and
PMDataManager::findAnalysisPass()

llvm-svn: 32377
2006-12-08 22:30:11 +00:00
Devang Patel 0e29e29cc5 During runOnModule() do initialization and finalization.
llvm-svn: 32371
2006-12-08 19:04:09 +00:00
Devang Patel 1929089ea2 Reuse code. Directly use runOnFunction().
llvm-svn: 32370
2006-12-08 19:03:05 +00:00
Devang Patel 1f65368a82 Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P)
llvm-svn: 32368
2006-12-08 18:57:16 +00:00
Andrew Lenharth dcb3c978c4 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Devang Patel e958559204 BasicBlockPassManager_New::runOnFunction()
Do initialization and finalization.

llvm-svn: 32346
2006-12-08 01:38:28 +00:00
Devang Patel 475c453c00 doInitialization and doFinalization for BasicBlockPassManager_New
llvm-svn: 32345
2006-12-08 00:59:05 +00:00
Devang Patel 17ad096dd8 Reimplement removeDeadPasses().
llvm-svn: 32344
2006-12-08 00:37:52 +00:00
Devang Patel bc03f13b75 set Last User.
llvm-svn: 32342
2006-12-07 23:55:10 +00:00
Bill Wendling 30c0f3367c Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Devang Patel 4c36e6bee0 Maintain level(or depth) of pass manager in pass manager food chain.
llvm-svn: 32339
2006-12-07 23:24:58 +00:00
Devang Patel 1d6267cac3 New method, PMDataManager::collectRequiredAnalysisPasses()
llvm-svn: 32338
2006-12-07 23:05:44 +00:00
Devang Patel 4949fe01f1 When new pass manager is created, initialize available analysis info
of existing manager at the same level. Otherwise, such info may be
considered as available, which not true.

llvm-svn: 32334
2006-12-07 22:34:21 +00:00
Devang Patel f4805ce89a PMDataManager does not maintain LastUser info.
llvm-svn: 32332
2006-12-07 22:17:09 +00:00
Devang Patel 17bff0dbdc Make current pass info available _after_ removing info that is not
preserved.

llvm-svn: 32329
2006-12-07 22:09:36 +00:00
Devang Patel 642c1437cf Add TODOs
llvm-svn: 32328
2006-12-07 21:58:50 +00:00
Devang Patel 28bbcbed4f Fix thinko.
llvm-svn: 32327
2006-12-07 21:44:12 +00:00
Devang Patel 31217aff9b Top level manages schedule the pass immediately at the time of insertion.
llvm-svn: 32326
2006-12-07 21:32:57 +00:00
Devang Patel abcd1d38ed Now FunctionPassManagerImpl_New and PassManagerImpl_New derives from
PMTopLevelManager.

llvm-svn: 32325
2006-12-07 21:27:23 +00:00