Commit Graph

624 Commits

Author SHA1 Message Date
Chris Lattner
0188534cd1 Instcombine this away:
%A = getelementptr [4 x int]* %M, long 0, long 0
        %B = getelementptr int* %A, long 2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4536 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:43:32 +00:00
Chris Lattner
0864acf07b Add a transformation to turn:
malloc Ty, C
int
  malloc [C x Ty], 1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4534 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 16:18:53 +00:00
Chris Lattner
35b74c4e54 Ack: Fix bug in previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4526 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 05:50:42 +00:00
Chris Lattner
38dc4f06af Be more generous about level raising constant expressions don't force each
constant to one particular type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4525 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 05:46:37 +00:00
Chris Lattner
af663465d6 Make sure to _delete_ memory allocated by worklists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-04 02:54:22 +00:00
Anand Shukla
93d545e691 code to lightly instrument at branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-03 01:45:20 +00:00
Chris Lattner
a145d4188c Make sure to include name information if we have it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4481 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 04:49:06 +00:00
Chris Lattner
e4b730441d Fixes to the reassociate pass to make it respect dominance properties
Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4471 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:12:59 +00:00
Chris Lattner
6918c079a1 BreakCriticalEdges should update dominance frontier information as well as
other dominance stuff.  Patch contributed by Casey Carter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4457 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 02:44:36 +00:00
Misha Brukman
a3bbcb5b66 Fix spelling of `propagate'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4423 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:06:16 +00:00
Chris Lattner
0ceeb42c97 Ensure definate initialization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4263 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-22 23:34:11 +00:00
Chris Lattner
cb2610ea03 - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4255 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-21 20:00:28 +00:00
Chris Lattner
1a33e31758 * Apparently string::find doesn't work right on our sun boxes. Work around this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4219 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-17 16:22:08 +00:00
Chris Lattner
c966a2acee Really disable pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-17 04:57:09 +00:00
Chris Lattner
69da5cf261 - Change Function's so that their argument list is populated when they are
constructed.  Before, external functions would have an empty argument list,
    now a Function ALWAYS has a populated argument list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
0b16ae209a - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 19:39:16 +00:00
Chris Lattner
eaa359586c Account for global variables resolved more accurately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:30:30 +00:00
Chris Lattner
66c25ff438 Use methods that are more explanatory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4142 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:12:47 +00:00
Anand Shukla
3383b1d3bb Changed to external global var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4120 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-12 20:33:47 +00:00
Chris Lattner
7a11a94183 Stop using DataStructureGraph.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4106 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-10 20:33:46 +00:00
Chris Lattner
c67ebfa788 - Dramatically simplify the ConstantMerge code now that
Value::replaceAllUsesWith works with constants correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4104 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 23:16:04 +00:00
Chris Lattner
a45ec54a02 Almost a complete rewrite of FunctionResolution to now resolve functions
and global variables.

This fixes bug: FuncResolve/2002-08-19-ResolveGlobalVarsEasier.ll
And bug: SingleSource/UnitTests/2002-10-09-ArrayResolution.c

Note that this does not fix bug:
FunctionResolve/2002-08-19-ResolveGlobalVars.ll because replaceAllUsesWith
breaks when a constantexpr is pointing to the thing being replaced.  This
is more of an infrastructure problem than anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4099 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 21:10:06 +00:00
Chris Lattner
cd484a47ea - Rename MTy to FTy (no methods exist anymore)
- Fix bug: LevelRaise/2002-10-08-VarArgCallInfLoop.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4088 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 00:16:00 +00:00
Chris Lattner
61b92c02b4 - Fix bug: LevelRaise/2002-10-08-VarArgCall.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4083 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 22:19:25 +00:00
Chris Lattner
d3d06a5cd8 - Fix bug: cee/2002-10-07-NoImmediateDominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:53:51 +00:00
Chris Lattner
dee430d26e Changes to support PHINode::removeIncoming changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4080 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:36:34 +00:00
Chris Lattner
bb190ac8da Changes to support PHINode::removeIncoming changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4079 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:36:33 +00:00
Chris Lattner
f7f009d9a5 - Checkin LARGE number of Changes to CEE pass that will make it much more
powerful, but that are largely disabled.  The basic idea here is that it
    is trying to forward branches across basic blocks that have PHI nodes in
    it, which are crucial to be able to handle cases like whet.ll.
    Unfortunately we are not updating SSA correctly, causing sim.c to die, and I
    don't have time to fix the regression now, so I must disable the
    functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4077 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:34:15 +00:00
Chris Lattner
e802a023d9 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:06:27 +00:00
Chris Lattner
57b314cfb1 It is illegal for PHI nodes to have zero values, delete the code to handle them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4071 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 17:07:39 +00:00
Chris Lattner
6eaeb5764c Fold ashr -1, X into -1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4070 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 16:16:40 +00:00
Chris Lattner
7c1faf0f59 Non-functionality change just to make it more clear what is going on
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4060 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-07 18:34:32 +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
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
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
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
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
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