Commit Graph

2232 Commits

Author SHA1 Message Date
Anand Shukla
c1d4d79d93 added cast to unsigned to compile with gcc3.2 (sparc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4041 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-04 23:56:18 +00:00
Chris Lattner
7d821db958 Handle post dominance correctly in the case where blocks do not have a path to
the exit node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4038 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-04 14:50:20 +00:00
Chris Lattner
4e4caeffbd Fix a nasty problem with dominance calculation for unreachable blocks.
If we had a CFG that look like Entry -> B, Unreachable -> B, then we would
not correctly determine that Entry dominated B, because Entry did not
apparently dominate "unreachable".  This patch fixes this by making the entry
node dominate all blocks, including unreachable ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4037 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-04 14:45:48 +00:00
Chris Lattner
a00397e1ee Prune function nodes that are no longer referenced due to inlining
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4036 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 21:55:28 +00:00
Chris Lattner
6727ec64e8 sgefa uses truely huge data structures nodes. Only print part of them if they
are so big


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4035 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 21:55:13 +00:00
Chris Lattner
62d928eac1 Handle bug exposed by power benchmark
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4033 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 21:06:38 +00:00
Nick Hildenbrandt
d2eb386c16 Add parens around constant calls to getelemptr to properly associate the reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4032 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 20:47:24 +00:00
Chris Lattner
55c1058135 Reimplement/port the Bottom Up Closure pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4031 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 20:38:41 +00:00
Chris Lattner
c5f21de2bc DataStructure.h doesn't include DSGraph.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4029 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 22:14:38 +00:00
Nick Hildenbrandt
ca626922bc I was wrong on the removing of those references on the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4023 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:14:33 +00:00
Chris Lattner
005cbce20e * Implement the getc() function
* Support usage of stdin, stdout & stderr correctly in LLI!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4022 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:12:13 +00:00
Chris Lattner
849735ce22 Cleanup #includes, expose module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4021 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:11:16 +00:00
Chris Lattner
dbaf74d108 Expose TD to ExternalFunctions.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4020 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:10:48 +00:00
Chris Lattner
061269be97 - Print the predecessors of a basic block instead of the number of uses of
the block in the AsmWriter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4019 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 19:38:55 +00:00
Chris Lattner
b6984558c5 Fix bug: 2002-10-02-SignExtensionProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4017 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:53:14 +00:00
Nick Hildenbrandt
51c84d14ab Removed unneeded reference and dereferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:34:51 +00:00
Nick Hildenbrandt
275801b2dd Cleaned up my last check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:32:35 +00:00
Nick Hildenbrandt
113ad893b9 No longer include malloc.h. If protoypes are needed for memory functions they will be present in the byte code and the generated c as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:20:18 +00:00
Chris Lattner
e03f32bcc2 * Implement fully general merging of array subscripts on demand! This
does not handle the initial pointer index case yet though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4012 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 06:24:36 +00:00
Chris Lattner
9cfb358fa4 When printing DS nodes, print the mergemap index as well to allow easier
debugging of merging process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4010 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 05:17:55 +00:00
Chris Lattner
7b7200c4ea * Significant rework of DSNode to support arbitrary aliasing due to merging
* Now all and any bytes of a DSNode can be merged together individually.  This
  is neccesary to support the full generality of C and support aliasing
  correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4008 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 04:57:39 +00:00
Chris Lattner
e68bf61f6f Changes to work with Statistics rework
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4004 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:40:31 +00:00
Chris Lattner
a92f696b74 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:41 +00:00
Chris Lattner
6ee6bbeb04 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4001 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:37 +00:00
Chris Lattner
249be915df Build subdirs in parallel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4000 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:36:35 +00:00
Chris Lattner
96ef1b90c8 - Rework Statistics:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3999 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:35:45 +00:00
Chris Lattner
1c7ce2c7fe Initial checkin of Steensgaards context insensitive flow insensitive
alias analysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3997 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:34:12 +00:00
Chris Lattner
fccd06fcea Checkin some major reworks of data structure analysis. This is not done,
nor does it work very well, but I need to get it checked in before I break
the tree unintentionally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3996 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:33:50 +00:00
Chris Lattner
57b062a8cc Make sure to use the TimerGroup that we created!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3995 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 20:12:06 +00:00
Chris Lattner
ccc7bef873 Make sure not to count the PassManager wrapers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3994 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 20:08:11 +00:00
Chris Lattner
f1da555028 Factor timer code out of PassManager implementation, into a generic interface
exposed by Support/Timer.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3993 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 19:54:07 +00:00
Chris Lattner
6c38a79d77 Checkin generic interval timer support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3992 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 19:36:54 +00:00
Nick Hildenbrandt
c3dd2af428 Fixed to properly escape quotes in strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-30 21:11:55 +00:00
Chris Lattner
c8f25d91bd Minor tweak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:59:29 +00:00
Vikram S. Adve
aebdbe6988 Bug fix in folding getElementPtr instructions: don't fold one into
a predecessor if it has a non-zero first index and the predecessor
ends with a struct index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3982 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:55:05 +00:00
Chris Lattner
3f00ef9660 Fix a problem that was caused by stale analyses being in CurrentAnalyses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3981 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:50:22 +00:00
Chris Lattner
b461373fbc Fix bug in LICM that caused the previous big win. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3980 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:26:07 +00:00
Chris Lattner
952eaee239 Hoist the contents of Loops in depth first order in the dominator tree,
rather than in random order.  This causes LICM to be DRAMATICALLY more
effective. For example, on bzip2.c, it is able to hoist 302 loads and
2380 total instructions, as opposed to 44/338 before.  This  obviously
makes other transformations much more powerful as well!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3978 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:46:09 +00:00
Chris Lattner
b1f8aebc67 Fix printing of loop information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3977 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:43:04 +00:00
Chris Lattner
4d7a75a9e3 Improve printing of dominator sets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3976 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:42:42 +00:00
Chris Lattner
4d01892e36 Fix major bugs in dominator set & tree information updating
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3975 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:41:38 +00:00
Vikram S. Adve
4117459567 Convert DIRS to PARALLEL_DIRS. They can be built independently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3972 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 11:52:14 +00:00
Vikram S. Adve
1c397aae8e Added a couple of helper methods for live range construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:43 +00:00
Vikram S. Adve
9d67cd1468 Live ranges for Return value and return address of a Call are now
created here, simply by handling all implicit operands (which should
have been done anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:05:22 +00:00
Vikram S. Adve
f425884e27 Fixed method getReturnValue(): it should return NULL if the
callee does not return a value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:03:54 +00:00
Vikram S. Adve
ad9c978874 Fixed incorrect assertion: spill code for function ptr should be
handled like normal operands, not like other call arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3967 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:02:40 +00:00
Vikram S. Adve
ac67006bed Return address register should be marked as "result" for the JMPL instruction
since it is defined by the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3966 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 17:00:15 +00:00
Vikram S. Adve
87817653fe Live ranges for Return value and return address of a Call are no longer
created here.  Instead they are created in LiveRangeInfo.cpp.  This
simplifies the code here quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:59:05 +00:00
Vikram S. Adve
106604ea6d Simplified code that handles call args and rets, so it no longer
needs the RegClass list to be passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3964 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:56:59 +00:00
Vikram S. Adve
4a8bb2bf23 Simplify Call translation slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3963 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-28 16:55:41 +00:00
Vikram S. Adve
94c408104a Overhaul integer conversions to match C++ ISO standard.
Don't allow direct FP-to-uint conversion (must be eliminated by preselection).
Address arithmetic for arrays is now entirely 64-bit so no sign-ext needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3961 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:33:08 +00:00
Vikram S. Adve
5cededee92 Modify operand order for Create{Sign,Zero}ExtensionInstructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3960 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:29:45 +00:00
Vikram S. Adve
7e5167a3e2 Bug fix: some redundant copies were not being deleted after detection :-|.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3959 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:27:37 +00:00
Vikram S. Adve
1c10f17552 Sign-extend integer constants from original type size to 64 bits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3958 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:26:20 +00:00
Vikram S. Adve
e9cb735131 Decompose FP-to-UInt casts into FP-to-ULong-toUInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3957 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-27 14:24:45 +00:00
Chris Lattner
009cc3d2e8 First try at implementing the AliasSetTracker class. I'm sure it will need
revision as I start to use it though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3954 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 21:49:07 +00:00
Chris Lattner
99a57216a9 - Further cleanups of LICM pass, remove extra work from previous implementation
- Do not clone instructions then insert clone outside of loop.  Just move them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3951 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 19:40:25 +00:00
Chris Lattner
94170596b7 Improve comments, doxygenize more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3950 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:52:07 +00:00
Chris Lattner
9646e6b6af Clean up LICM significantly now that it is guaranteed to have loop preheaders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:38:03 +00:00
Chris Lattner
0bd3616b0b Change pass name to something sane
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3946 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:37:37 +00:00
Chris Lattner
eb53ae4f2d Loop invariant code motion now depends on the LoopPreheader pass. Dead code
has not yet been removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3945 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:19:31 +00:00
Chris Lattner
c178d9459a - Cleanup break-crit-edges pass by making SplitCriticalEdge a member method.
- break-crit-edges pass does not invalidate loop-preheader pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3944 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:18:51 +00:00
Chris Lattner
38acf9e85d Checkin new loop-preheader insertion pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3942 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:17:31 +00:00
Chris Lattner
fce46ef803 Fix printing of loop information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3941 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:15:54 +00:00
Chris Lattner
d74472ed21 - Add methods to ImmediateDominators & DominatorTree to allow updates
- Make DominatorTree::Node not inherit from std::vector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3939 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:14:41 +00:00
Chris Lattner
699b305c86 - Add new methods to LoopInfo: getLoopPreheader, addBasicBlockToLoop.
These allow extra information to be easily gathered, and loopinfo to be
    updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3936 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 05:32:50 +00:00
Chris Lattner
0a1a874d1f - Add new ctor to BasicBlock to allow insertion before any BB, not just at
the end of the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3934 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 05:03:22 +00:00
Chris Lattner
3a15d70734 Converted SimpleStructMutation to take TargetData as a required pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3932 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 00:17:21 +00:00
Chris Lattner
3b2106ff84 Change LowerAllocations pass to 'require' TargetData instead of it being
passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3929 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 23:47:47 +00:00
Chris Lattner
aa31ad016a Convert TargetData to be an ImmutablePass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3927 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 23:46:55 +00:00
Chris Lattner
c3a388143b Convert BasicVN to be an ImmutablePass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3924 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 22:27:25 +00:00
Chris Lattner
6ffa0a7f7c * Fix ugly bug in previous checkin where I reused the name 'i' one too many times
* Print out immutable passes in the -debug-pass=Structure report.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3923 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 22:26:52 +00:00
Chris Lattner
70b4f3e051 Add support for ImmutablePasses, which are not run, and cannot be
invalidated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3921 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 21:59:11 +00:00
Nick Hildenbrandt
e548f009f7 Strings now handled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3920 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 20:29:26 +00:00
Chris Lattner
112e97dbee - Fix bug: Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3917 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 21:19:41 +00:00
Chris Lattner
2ada19ea04 Eliminate extraneous #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3916 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 21:18:40 +00:00
Chris Lattner
929b2c6900 Fix bug: SimplifyCFG/2002-09-24-PHIAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3913 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 16:09:17 +00:00
Chris Lattner
f03cafc280 - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3911 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:52:01 +00:00
Chris Lattner
eb0456c8fd - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3910 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:51:56 +00:00
Chris Lattner
16e7a5295f Correlated Exprs pass now requires BCE pass instead of doing it manually
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3908 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:43:56 +00:00
Chris Lattner
6de302bbdb - Expose passinfo from BreakCriticalEdges pass so that it may be "Required"
by other passes.  Make BCE pass be in anonymous namespace now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 15:43:12 +00:00
Chris Lattner
3abb95df01 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3904 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 00:09:26 +00:00
Chris Lattner
d76efa0186 Add new BreakCriticalEdges pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3903 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 00:08:39 +00:00
Chris Lattner
5057b00faf Make users of FindUsedTypes not have problems with linkage. This fixes
Cwriter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3900 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-24 00:07:21 +00:00
Chris Lattner
d06451f920 Optimize away cases like:
%cast109 = cast uint %cast212 to short          ; <short> [#uses=1]
        %cast214 = cast short %cast109 to uint          ; <uint> [#uses=1]
        %cast215 = cast uint %cast214 to short          ; <short> [#uses=1]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3897 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 23:39:43 +00:00
Chris Lattner
e4314ed315 Fix: ConstantMerge/2002-09-23-CPR-Update.ll
Basically, this bug boiled down to calling replaceUsesOfWith on a constant,
which changed it's shape in an illegal way.  This pass now goes through all
of the trouble neccesary to do the replacement on constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 23:00:46 +00:00
Nick Hildenbrandt
c14ded4858 Parenthesis are now added to casts of type array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3892 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 21:02:50 +00:00
Chris Lattner
c017d9132a * Fix bug: CorrelatedExprs/2002-09-23-PHIUpdateBug.ll
* Make sure "Changed" is updated correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3891 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 20:06:22 +00:00
Chris Lattner
d149c053cd Insert resolved constants into the global map so they are reused correctly.
This bug was exposed linking the SPEC benchmark suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3888 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 18:14:15 +00:00
Vikram S. Adve
1b5710a8fc Put intermediate source files in a subdirectory here instead of with
object files.  Also,


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3884 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 13:12:28 +00:00
Vikram S. Adve
c308aefe92 Disable reassociation pass in LLC until it is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3883 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 12:55:50 +00:00
Chris Lattner
bdccb00970 Don't insert a PHI node to merge "returns" from an inlined function if there
is only a single return from the function!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3878 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-22 18:41:25 +00:00
Anand Shukla
c078930ee3 Changed codegen to add 2 empty slots at the top of stack using StackSlots pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3873 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-21 05:01:21 +00:00
Anand Shukla
33db9bae15 Initial version: it adds 2 empty slots at the top of stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3872 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-21 04:58:26 +00:00
Chris Lattner
d1cf1b458a Fix cwriter to not output FP constants in ascii, output them in hex instead.
This fixes a number of FP precision problems, making the output of the
power benchmark closer to the right answer.

Unfortunately, this only addresses FP constants used directly in functions.
Constants referred to by global constants (such as an array of FP values)
aren't helped by this.  Until this happens power won't work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 23:26:33 +00:00
Chris Lattner
1f8c4a17c1 Fix bug: 2002-09-20-VarArgPrototypes.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 22:32:30 +00:00
Anand Shukla
4f2d5a4d76 Changed uchar to unsigned char in function ParseBytecodeBuffer, because seemingly it affects opt in uncertain ways :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3866 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 20:57:54 +00:00
Anand Shukla
590df88d82 Added checking threshold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3864 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 16:44:35 +00:00
Chris Lattner
270d78a8d6 Fix output of typedefs to avoid syntax errors.
* We now can correctly Cify the Olden-power benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3860 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:20:24 +00:00
Chris Lattner
58d04d4e35 * Add a couple of comments to the output c code
* _FIX_ infinite recursion problem, due to typedefs of a structure being
  printed before the structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:18:30 +00:00
Chris Lattner
2db41cd5de Another change that doesn't affect functionality. Since we are only looking
at types in the symbol table, only traverse the type plane, saving a loop nest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:12:13 +00:00
Chris Lattner
2c601a7be1 Make the StructPrinted set only take memory when it's being used.
rename parseStruct to printContainedStructs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:05:40 +00:00
Chris Lattner
a4c047ec27 No functionality changes, primarily just changing tab indentation to space
indentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 14:56:54 +00:00
Vikram S. Adve
0efb50761d Add method IGNode::getCombinedDegree to count the sum of the degrees
of two nodes, excluding duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3848 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:55:04 +00:00
Vikram S. Adve
57e14bd757 Add PostOpts/ and rename PreSelection/ to PreOpts/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3847 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:53:53 +00:00
Vikram S. Adve
e5b2565a02 Add peephole optimization pass at the end of code generation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3846 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:52:43 +00:00
Vikram S. Adve
d55697cf13 Added class MachineOptInfo as interface to target-specific
routines supporting machine code optimization.
Also added method MachineInstrInfo::getNOPOpCode().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3845 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:52:09 +00:00
Vikram S. Adve
e8b57ef260 Add method MachineInstr::replace to rewrite a machine instruction in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3843 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:47:49 +00:00
Vikram S. Adve
32f81a3469 Allow copy coalescing in more cases: if sum of node degrees is more than
than #available regs, compute the sum excluding duplicates and if that
is less than #regs, go ahead and coalesce.
Add method IGNode::getCombinedDegree to count excluding duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3842 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:45:47 +00:00
Vikram S. Adve
25d80cdcc6 Peephole optimization pass on final machine code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:42:11 +00:00
Vikram S. Adve
fafda59f08 Files moved to CodeGen/PreOpts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:30:46 +00:00
Vikram S. Adve
abf055c698 Moving these files from Code/PreSelection to here.
Original logs for PreSelection.cpp:

  revision 1.2
  date: 2002/09/17 23:50:32;  author: lattner;  state: Exp;  lines: +1 -3
  Don't put default parameter values into .cpp files, it breaks 3.x compilers

  revision 1.1
  date: 2002/09/16 15:31:13;  author: vadve;  state: Exp;
  New preselection pass that specializes LLVM code for a target machine,
  while remaining in legal portable LLVM form and preserving type
  information and type safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3838 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 00:29:28 +00:00
Chris Lattner
3f6962e088 Add an optimization to support the most common access pattern for the
library.  This speeds debug builds up significantly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3826 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-19 19:22:11 +00:00
Chris Lattner
3e1f144a1d Make sure that we abort if an error happens as early as neccesary. Before
it was possible for the passmanager to continue running passes after the
verifier even if the module was not well formed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-19 16:12:19 +00:00
Anand Shukla
6689b06697 split retracing into a separate file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3809 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-18 03:55:26 +00:00
Chris Lattner
ec9962e44a Compile sub-directories in parallel, because they don't have interdependencies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3808 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-18 03:25:58 +00:00
Misha Brukman
bfb472447e Removed unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3802 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-18 02:07:57 +00:00
Misha Brukman
5f41748e1a Fixed typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3801 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-18 00:42:45 +00:00
Chris Lattner
5fda99744e Don't put default parameter values into .cpp files, it breaks 3.x compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3799 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 23:50:32 +00:00
Chris Lattner
cb16c65426 There is a #define in some header that conflicts with INFINITY, rename it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3797 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 23:46:33 +00:00
Chris Lattner
dfcbf01222 Fix bug: test/Regression/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll
Thanks to Casey for finding it!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3783 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 21:05:42 +00:00
Anand Shukla
b379470b90 Removed debug info printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 20:24:46 +00:00
Chris Lattner
82f05d8610 Add support for GCC 2.96
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 17:23:09 +00:00
Vikram S. Adve
913bfbc2e4 Don't print global variable definitions twice! Sun's pathetic compiler
never complained about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 11:50:38 +00:00
Vikram S. Adve
d9bacc5a84 Remove specification of argument default from cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3772 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 01:17:57 +00:00
Chris Lattner
dbcbe3f7e8 Fix FunctionInlining pass assertion failure:
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3768 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 22:30:20 +00:00
Chris Lattner
8e2e5f74da Fix: test/Regression/LLC/badidx.c problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3763 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 18:32:33 +00:00
Vikram S. Adve
c7a6d24cef Extract most of the transformation into an externally accessible
function -- DecomposeArrayRef(GetElementPtrInst* GEP) -- that can
be invoked on a single instruction at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3755 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 16:40:07 +00:00
Vikram S. Adve
e102a64beb Use ulong instead of uint for size expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3744 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:56:45 +00:00
Vikram S. Adve
4900116ab0 Add methods to query about the representation of LLVM quantities (e.g.,
constants).  Useful for target-dependent LLVM transformations like
Preselection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3743 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:56:01 +00:00
Vikram S. Adve
13f1d71c80 Don't print out global names unnecesssarily. Also, expose pass
constructors so passes can be inserted by TargetMachine.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3742 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:54:02 +00:00
Vikram S. Adve
e1f7280bf8 Move all the code that creates code generation passes from Sparc.cpp to
TargetMachine.cpp, since it is entirely machine-independent.
Also, add options to disable optional back-end passes (preselection and
instr. scheduling).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3740 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:39:26 +00:00
Vikram S. Adve
00020d3d01 Add subdirectory PreSelection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3739 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:32:07 +00:00
Vikram S. Adve
7f90ea209a New preselection pass that specializes LLVM code for a target machine,
while remaining in legal portable LLVM form and preserving type
information and type safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3738 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:31:13 +00:00
Vikram S. Adve
8c6936a58b Dump routine now writes out allocated register numbers if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3737 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:18:53 +00:00
Vikram S. Adve
1318bed20c Improve and fix error in allocating stack slots: adjust alignment after adding
base address of the relevant region (instead of assuming that each region
is maximally aligned).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3736 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:18:16 +00:00
Vikram S. Adve
fd0ec80197 Add a version of ChooseRegOrImmed to handle numerical constants
introduced by InstrSelection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3735 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:15:57 +00:00
Vikram S. Adve
87fbcd99b4 Add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3734 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 15:13:59 +00:00
Anand Shukla
6641995564 Incorporated changes in alloca and getElementPointer instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3733 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 05:26:51 +00:00
Anand Shukla
ada50a5c1d Incorporated changes in alloca instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3732 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 05:24:49 +00:00
Vikram S. Adve
9d6f13f34b No longer need to sign-extend array indices to 64 bits since they
are now longs and not unsigned ints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 21:51:04 +00:00
Vikram S. Adve
993243e599 Fix typos in previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 15:33:48 +00:00
Chris Lattner
4bc2348008 RegAllocCommon no longer includes CommandLine.h so we have to include it
here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3725 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15 07:07:55 +00:00
Vikram S. Adve
39c94e105f Break RA_DEBUG option into several levels to get better control over
debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3724 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:05:33 +00:00
Vikram S. Adve
521758fb79 Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3723 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 23:04:52 +00:00
Vikram S. Adve
7e914a967d Break RA_DEBUG option into several levels to get better output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3722 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 22:18:37 +00:00
Nick Hildenbrandt
67aa2e235d Fixed problem with printing struct definitions in the correct order.
This allows for the Regression/Transforms/ScalarReplacement/scalarize.c to run correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 21:36:24 +00:00
Chris Lattner
b2a0fbea11 Fix bug I introduced
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3719 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 19:33:16 +00:00
Vikram S. Adve
7c26898401 Moving to lib/CodeGen/RegAlloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3718 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 11:57:17 +00:00
Misha Brukman
655fb5c817 Function.h is unnecessary when Module.h is included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 03:04:02 +00:00