Commit Graph

1756 Commits

Author SHA1 Message Date
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
Devang Patel
54e247d2d0 removeNotPreservedAnalysis().
Do not remove ImmutablePass from the list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:07:44 +00:00
Devang Patel
395ed73984 Initialize activeManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:57:43 +00:00
Devang Patel
1e1008a52e Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:56:36 +00:00
Devang Patel
a5f9d556b7 Maintain ImmutablePasses list at top level only. Do not make them
directly available to individual managers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:53:40 +00:00
Devang Patel
d0fa16c336 findAnalysisPass().
First search all available passes before searching ImmutablePasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32503 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:50:05 +00:00
Devang Patel
7e601a70fc Fix thinko.
While searching for a analysis in a pass manager, do not search it into
pass manager's manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:47:13 +00:00
Devang Patel
1b8d015066 o s/OtherPassManagers/IndirectPassManagers
o Make IndirectPassManagers vector of PMDataManager *
o Move PMTopLevelManager implementation below all class declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:35:25 +00:00
Devang Patel
689c683bcc Initialize AnalysisImpls for ImmutablePass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:21:37 +00:00
Devang Patel
dff33ef8e8 Set top level manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:02:16 +00:00
Reid Spencer
f25212a223 Don't create usless casts for same-bith-width floating point casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:38:50 +00:00
Reid Spencer
84f3eab017 Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
to the createIntegerCast and createFPCast for CastInst instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32457 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 00:51:07 +00:00
Reid Spencer
6d81a7d2ae 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32456 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 00:49:44 +00:00
Reid Spencer
8c4fed50e3 Fix constant folding of FP->int due to cut & paste error in last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 21:27:28 +00:00
Chris Lattner
14f440aae7 Implement correct constant folding of bitcast. This implements
Transforms/ConstProp/bitcast.ll and fixes
SingleSource/Regression/C/2003-10-12-GlobalVarInitializers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32438 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 18:30:27 +00:00
Chris Lattner
36c2451ddb fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32428 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 02:16:58 +00:00
Chris Lattner
87f28e87d7 fix PR1039 by making timing info be destroyed by llvm_shutdown, not by
static dtors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32411 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-10 07:40:46 +00:00
Devang Patel
298feadd7a Analysis resolver now manages AnalysisImpls for the given patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32389 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 01:11:34 +00:00
Devang Patel
5b640e7edc Top level pass manager keeps track of other managers, so this can be
removed now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32388 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 00:09:12 +00:00
Devang Patel
cd520b187a Use analysis resolver to find the info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32387 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 00:07:38 +00:00
Devang Patel
c9a6293af7 Do not drop ImmutablePasses on the floor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32386 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:57:43 +00:00
Devang Patel
145e83dc12 Set AnalysisResolver for the passes when they are inserted into
pass manager queuer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32385 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:53:00 +00:00
Devang Patel
f3dc6d9f95 Add AnalysisResolver_New. It is a replacement for existing
AnalysisResolver.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32383 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:28:54 +00:00
Devang Patel
591b1b7526 Keep track of other pass managers, that are not directly managed by
top level manager. Use this info to findAnalysisPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32382 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 23:11:43 +00:00
Devang Patel
c475692c5e Implement top level FunctionPassManager::run(Function &F)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32381 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:57:48 +00:00
Devang Patel
a083e94f79 Do not keep yet another list of pass managers in PassManagerImpl_New.
Use one provided by toplevel manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:47:25 +00:00
Devang Patel
e61b7478e5 Remove unused schedulePass() parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32379 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:34:02 +00:00
Devang Patel
3279d4c781 Remove unused getAnalysisPass and getAnalysisPassFromManager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32378 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:32:32 +00:00
Devang Patel
69867b511c Implement PMTopLevel::findAnalysisPass() and
PMDataManager::findAnalysisPass()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32377 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 22:30:11 +00:00
Devang Patel
4d9a186b10 During runOnModule() do initialization and finalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32371 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 19:04:09 +00:00
Devang Patel
97856ceeab Reuse code. Directly use runOnFunction().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32370 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 19:03:05 +00:00
Devang Patel
cc132cd9fe Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32368 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:57:16 +00:00
Andrew Lenharth
38ecbf18eb Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:06:16 +00:00
Devang Patel
3b14fbe300 BasicBlockPassManager_New::runOnFunction()
Do initialization and finalization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32346 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 01:38:28 +00:00
Devang Patel
964e45e607 doInitialization and doFinalization for BasicBlockPassManager_New
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32345 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 00:59:05 +00:00
Devang Patel
f9a60ae75d Reimplement removeDeadPasses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32344 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 00:37:52 +00:00
Devang Patel
e166340650 set Last User.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32342 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:55:10 +00:00
Bill Wendling
1a097e30d3 Don't use <sstream> in Streams.h but <iosfwd> instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32340 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:41:45 +00:00
Devang Patel
f72d29c540 Maintain level(or depth) of pass manager in pass manager food chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32339 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:24:58 +00:00
Devang Patel
c17bbb6da7 New method, PMDataManager::collectRequiredAnalysisPasses()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32338 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:05:44 +00:00
Devang Patel
badc4fae53 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32334 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 22:34:21 +00:00
Devang Patel
6e49d8b4bf PMDataManager does not maintain LastUser info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32332 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 22:17:09 +00:00
Devang Patel
0ac961d9c1 Make current pass info available _after_ removing info that is not
preserved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32329 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 22:09:36 +00:00
Devang Patel
b917e38c84 Add TODOs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32328 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:58:50 +00:00
Devang Patel
502f19e0f8 Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32327 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:44:12 +00:00
Devang Patel
877bfbb9ef Top level manages schedule the pass immediately at the time of insertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32326 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:32:57 +00:00
Devang Patel
eb0d613ef6 Now FunctionPassManagerImpl_New and PassManagerImpl_New derives from
PMTopLevelManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32325 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:27:23 +00:00
Devang Patel
1209f416cf Reimplement schedulePass interface. Move it into PMTopLevelManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32324 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:10:57 +00:00
Devang Patel
1b17033bc7 While initializing AvailableAnalysis info, make ImmutablePasses available
immediately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32323 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 21:02:08 +00:00
Devang Patel
3e44559d01 Add ImmutablePass into the list of info managed by top level pass
manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32322 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:51:18 +00:00
Bill Wendling
832171cb97 Removing even more <iostream> includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:04:42 +00:00
Devang Patel
04b4e0595f If pass reserves all analysis info then each info is not separately
included in PreservedSet. So check getPreservesAll() first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32319 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:03:49 +00:00
Devang Patel
66d72e140b Pass Managers themselves do not invalidate any analysis info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32318 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 19:57:52 +00:00
Devang Patel
dc48f203cd Add a handle to the top level pass manager in PMDataManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32317 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 19:54:15 +00:00
Devang Patel
06e86561a5 Cosmetic markers to divide code in separate chunks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32316 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 19:39:39 +00:00
Devang Patel
f32b4dd13e s/noteDownAvailableAnalysis/recordAvailableAnalysis
While recording available analysis, include interfaces implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32315 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 19:33:53 +00:00
Devang Patel
3f5d2b58b8 Add PMTopLevelManager. It is not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32314 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 19:21:29 +00:00
Devang Patel
4045af1175 RequiredAnalysis support is buggy and not used at the moment so remove
the code. Add TODO note.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32313 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 18:47:25 +00:00
Devang Patel
cbfd29d0da s/clearAnalysis/initializeAnalysisInfo/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32312 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 18:41:09 +00:00
Devang Patel
419f0e95d6 s/CommonPassManagerImpl/PMDataManager/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32311 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 18:36:24 +00:00
Devang Patel
e77242c3d5 Add overview of pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 18:23:30 +00:00
Reid Spencer
6b538cfc5c Provide a getOpcode() method on CmpInst to ensure the opcode is returned
as the right type. Use this to shorten some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32300 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 04:18:31 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Reid Spencer
5c14a1bcb0 For PR950:
Remove the getMaxValue and getMinValue functions from ConstantIntegral.
They don't make sense for a signless type. Also, for isMaxValue and
isMinValue, have the caller provided the signedness rather than obtaining
it from the constant's type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32287 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 20:30:17 +00:00
Chris Lattner
82c4bc7153 Remove the dead CachedWriter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32271 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 06:40:49 +00:00
Chris Lattner
2fcfdb79d0 printName is almost always true. In the cases that mattered where it was false,
it was effectively set to true by this:

-  if ((PrintName || isa<GlobalValue>(V)) && V->hasName())
+  if (V->hasName())

Delete printname entirely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32265 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 06:24:27 +00:00
Chris Lattner
3749c9cae4 Remove the 'printname' argument to WriteAsOperand. It is always true, and
passing false would make the asmprinter fail anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32264 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 06:16:21 +00:00
Chris Lattner
a6b1ffcfaa The hasSlot methods are gone.
Remove the 'PrintName' argument to WriteAsOperand, as it is always true.
Only call getOrCreateSlot on things that are valid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32263 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 06:15:43 +00:00
Chris Lattner
4932a5a335 remove unused api, simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32260 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 05:55:41 +00:00
Chris Lattner
919e70c3ff remove more code that was only used by the bc writer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32259 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 05:50:41 +00:00
Chris Lattner
c3e56e20e4 remove dead code left over from when this functionality was shared with the
bcwriter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32258 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 05:42:32 +00:00
Chris Lattner
de891a6c35 rename createSlot -> getOrCreateSlot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32256 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 05:27:40 +00:00
Chris Lattner
c96ce89c97 clean up some sloppy and inconsistent spacing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32255 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 05:12:21 +00:00
Chris Lattner
d6d826cdad wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32254 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 04:41:52 +00:00
Reid Spencer
87d5f6c29f Fix constant folding to deal with external weak global values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32247 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 00:25:09 +00:00
Chris Lattner
518f6fa310 Fix Transforms/InstCombine/2006-12-05-fp-to-int-ext.ll, fixing an out-of-
stack-space issue in the ppc bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32244 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 23:43:59 +00:00
Reid Spencer
7858b336f2 Bail on the getInferredCast idea. Remove the function and convert
remaining uses to more specific casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32231 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 19:14:13 +00:00
Reid Spencer
6f40b831e0 Can't make these fail now with just BitCast. Previous failures must have
been in conjunction with something else. By right, they should just be
BitCasts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32219 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 07:18:07 +00:00
Reid Spencer
57c699381b Remove the last inferred casts from VMCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32213 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 03:30:09 +00:00
Reid Spencer
330d86d748 Implement createPointerCast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32212 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 03:28:26 +00:00
Reid Spencer
c0459fb7f5 Implement getPointerCast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32211 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 03:25:26 +00:00