1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

792 Commits

Author SHA1 Message Date
Chris Lattner
58944216ff Fix symbol table problem
llvm-svn: 4785
2002-11-20 19:32:43 +00:00
Chris Lattner
b5027095e5 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
ec0df74910 Fix minor bugs
llvm-svn: 4778
2002-11-20 18:32:31 +00:00
Chris Lattner
62629300d3 Remove unneccesary #include
llvm-svn: 4772
2002-11-19 23:12:53 +00:00
Chris Lattner
4053d2dd12 Implement the CloneFunction function
llvm-svn: 4771
2002-11-19 23:12:22 +00:00
Chris Lattner
e5a05ec13b Minor changes to cloning interface
llvm-svn: 4770
2002-11-19 22:54:01 +00:00
Chris Lattner
aff50cfe1d Fix two fixmes: integrate with inlining, and document
llvm-svn: 4769
2002-11-19 22:04:49 +00:00
Chris Lattner
27bf5916fb Rework inline pass to use cloning infrastructure to do the dirty work
llvm-svn: 4766
2002-11-19 21:54:07 +00:00
Chris Lattner
ccb8790bc4 Start using the new function cloning header
llvm-svn: 4764
2002-11-19 20:59:41 +00:00
Chris Lattner
7e4c65114b Move MutatStructTypes.h out of IPO
llvm-svn: 4762
2002-11-19 20:49:40 +00:00
Chris Lattner
17da38496e Rename CloneFunction.h to Cloning.h
llvm-svn: 4760
2002-11-19 20:08:24 +00:00
Chris Lattner
adea9960ab Move the function extractor pass from tools/extract into lib/Xform/IPO
llvm-svn: 4759
2002-11-19 18:42:59 +00:00
Chris Lattner
996bf14a4f Fix bug: 2002-11-13-PointerFunction.ll
This should fix codegen on vortex to work much better

llvm-svn: 4704
2002-11-13 06:54:20 +00:00
Chris Lattner
96d1bfd014 Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
llvm-svn: 4668
2002-11-10 03:36:55 +00:00
Chris Lattner
0141841bc4 Fix warning
llvm-svn: 4649
2002-11-09 00:49:43 +00:00
Chris Lattner
f03f32d2e8 Fix spelling error
llvm-svn: 4645
2002-11-08 23:18:37 +00:00
Chris Lattner
7252fe359e Use the new getMainFunction() method to efficiently locate main
llvm-svn: 4630
2002-11-08 20:34:21 +00:00
Chris Lattner
d5dc2c1417 Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
llvm-svn: 4618
2002-11-08 00:38:20 +00:00
Chris Lattner
aaf2fa34a5 Instcombine this away:
%A = getelementptr [4 x int]* %M, long 0, long 0
        %B = getelementptr int* %A, long 2

llvm-svn: 4536
2002-11-04 16:43:32 +00:00
Chris Lattner
ecddf3396f Add a transformation to turn:
malloc Ty, C
int
  malloc [C x Ty], 1

llvm-svn: 4534
2002-11-04 16:18:53 +00:00
Chris Lattner
e27815a482 Ack: Fix bug in previous checkin.
llvm-svn: 4526
2002-11-04 05:50:42 +00:00
Chris Lattner
81135c4c57 Be more generous about level raising constant expressions don't force each
constant to one particular type.

llvm-svn: 4525
2002-11-04 05:46:37 +00:00
Chris Lattner
b9fa84c1ed Make sure to _delete_ memory allocated by worklists
llvm-svn: 4523
2002-11-04 02:54:22 +00:00
Anand Shukla
bf2fc13a2f code to lightly instrument at branches
llvm-svn: 4511
2002-11-03 01:45:20 +00:00
Chris Lattner
d94208782e Make sure to include name information if we have it
llvm-svn: 4481
2002-11-01 04:49:06 +00:00
Chris Lattner
b913f4e785 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!

llvm-svn: 4471
2002-10-31 17:12:59 +00:00
Chris Lattner
1ec9725ef8 BreakCriticalEdges should update dominance frontier information as well as
other dominance stuff.  Patch contributed by Casey Carter

llvm-svn: 4457
2002-10-31 02:44:36 +00:00
Misha Brukman
c9c721edf0 Fix spelling of `propagate'.
llvm-svn: 4423
2002-10-29 23:06:16 +00:00
Chris Lattner
b8ffbe6966 Ensure definate initialization
llvm-svn: 4263
2002-10-22 23:34:11 +00:00
Chris Lattner
b565d3ac5b - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.

llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner
79cf8950f1 * Apparently string::find doesn't work right on our sun boxes. Work around this.
llvm-svn: 4219
2002-10-17 16:22:08 +00:00
Chris Lattner
15d0113fc6 Really disable pool allocator
llvm-svn: 4216
2002-10-17 04:57:09 +00:00
Chris Lattner
82f54dca49 - 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.

llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner
fdf2ca9468 - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.

llvm-svn: 4147
2002-10-13 19:39:16 +00:00
Chris Lattner
9d067ad595 Account for global variables resolved more accurately.
llvm-svn: 4143
2002-10-13 17:30:30 +00:00
Chris Lattner
721a5fac62 Use methods that are more explanatory
llvm-svn: 4142
2002-10-13 17:12:47 +00:00
Anand Shukla
d80a46cb42 Changed to external global var
llvm-svn: 4120
2002-10-12 20:33:47 +00:00
Chris Lattner
8cd34b84b2 Stop using DataStructureGraph.h
llvm-svn: 4106
2002-10-10 20:33:46 +00:00
Chris Lattner
42547124d0 - Dramatically simplify the ConstantMerge code now that
Value::replaceAllUsesWith works with constants correctly.

llvm-svn: 4104
2002-10-09 23:16:04 +00:00
Chris Lattner
83d105d986 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.

llvm-svn: 4099
2002-10-09 21:10:06 +00:00
Chris Lattner
51d98b38f2 - Rename MTy to FTy (no methods exist anymore)
- Fix bug: LevelRaise/2002-10-08-VarArgCallInfLoop.ll

llvm-svn: 4088
2002-10-09 00:16:00 +00:00
Chris Lattner
e8160b4dd1 - Fix bug: LevelRaise/2002-10-08-VarArgCall.ll
llvm-svn: 4083
2002-10-08 22:19:25 +00:00
Chris Lattner
d68e6d1718 - Fix bug: cee/2002-10-07-NoImmediateDominator.ll
llvm-svn: 4081
2002-10-08 21:53:51 +00:00
Chris Lattner
c35f54df86 Changes to support PHINode::removeIncoming changes
llvm-svn: 4080
2002-10-08 21:36:34 +00:00
Chris Lattner
9c236351fd Changes to support PHINode::removeIncoming changes
llvm-svn: 4079
2002-10-08 21:36:33 +00:00
Chris Lattner
40df2d9d4c - 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.

llvm-svn: 4077
2002-10-08 21:34:15 +00:00
Chris Lattner
3cf20c3f14 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
llvm-svn: 4075
2002-10-08 21:06:27 +00:00
Chris Lattner
b32252aa71 It is illegal for PHI nodes to have zero values, delete the code to handle them
llvm-svn: 4071
2002-10-08 17:07:39 +00:00
Chris Lattner
55c7ae3cdc Fold ashr -1, X into -1
llvm-svn: 4070
2002-10-08 16:16:40 +00:00
Chris Lattner
c532e35cce Non-functionality change just to make it more clear what is going on
llvm-svn: 4060
2002-10-07 18:34:32 +00:00
Chris Lattner
88c8ffce8b Fix bug: 2002-10-02-SignExtensionProblem.ll
llvm-svn: 4017
2002-10-02 18:53:14 +00:00
Chris Lattner
3fec0954e8 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.

llvm-svn: 4004
2002-10-01 22:40:31 +00:00
Chris Lattner
7cf9f6f4b1 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.

llvm-svn: 4002
2002-10-01 22:38:41 +00:00
Chris Lattner
4cc183889f 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.

llvm-svn: 4001
2002-10-01 22:38:37 +00:00
Chris Lattner
b5d3e33496 Build subdirs in parallel
llvm-svn: 4000
2002-10-01 22:36:35 +00:00
Chris Lattner
61e8de1c61 Fix bug in LICM that caused the previous big win. :(
llvm-svn: 3980
2002-09-29 22:26:07 +00:00
Chris Lattner
ef0e95bb42 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!

llvm-svn: 3978
2002-09-29 21:46:09 +00:00
Chris Lattner
b731880895 Fix major bugs in dominator set & tree information updating
llvm-svn: 3975
2002-09-29 21:41:38 +00:00
Vikram S. Adve
69d19cf9a9 Convert DIRS to PARALLEL_DIRS. They can be built independently.
llvm-svn: 3972
2002-09-29 11:52:14 +00:00
Chris Lattner
0bbb8f6e06 - Further cleanups of LICM pass, remove extra work from previous implementation
- Do not clone instructions then insert clone outside of loop.  Just move them.

llvm-svn: 3951
2002-09-26 19:40:25 +00:00
Chris Lattner
0c66734ac5 Improve comments, doxygenize more
llvm-svn: 3950
2002-09-26 16:52:07 +00:00
Chris Lattner
21eb78d59d Clean up LICM significantly now that it is guaranteed to have loop preheaders
llvm-svn: 3947
2002-09-26 16:38:03 +00:00
Chris Lattner
9cdbd428b0 Change pass name to something sane
llvm-svn: 3946
2002-09-26 16:37:37 +00:00
Chris Lattner
fe9fba6f5b Loop invariant code motion now depends on the LoopPreheader pass. Dead code
has not yet been removed.

llvm-svn: 3945
2002-09-26 16:19:31 +00:00
Chris Lattner
f9676d651d - Cleanup break-crit-edges pass by making SplitCriticalEdge a member method.
- break-crit-edges pass does not invalidate loop-preheader pass.

llvm-svn: 3944
2002-09-26 16:18:51 +00:00
Chris Lattner
e5996b4c88 Checkin new loop-preheader insertion pass.
llvm-svn: 3942
2002-09-26 16:17:31 +00:00
Chris Lattner
7cdd2e0cb0 Converted SimpleStructMutation to take TargetData as a required pass.
llvm-svn: 3932
2002-09-26 00:17:21 +00:00
Chris Lattner
7ab2bba3d3 Change LowerAllocations pass to 'require' TargetData instead of it being
passed in.

llvm-svn: 3929
2002-09-25 23:47:47 +00:00
Chris Lattner
2cf19d980a - Fix bug: Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
llvm-svn: 3917
2002-09-24 21:19:41 +00:00
Chris Lattner
7fafece8e0 Eliminate extraneous #include
llvm-svn: 3916
2002-09-24 21:18:40 +00:00
Chris Lattner
54cf78c786 Fix bug: SimplifyCFG/2002-09-24-PHIAssertion.ll
llvm-svn: 3913
2002-09-24 16:09:17 +00:00
Chris Lattner
a4f47fb77e - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*

llvm-svn: 3911
2002-09-24 15:52:01 +00:00
Chris Lattner
25ba5ac7ce - Do not expose Critical Edge breaking mechanics outside the BCE pass, thus
removing it from Transforms/Local.h and from Transforms/Utils/*

llvm-svn: 3910
2002-09-24 15:51:56 +00:00
Chris Lattner
1014aae962 Correlated Exprs pass now requires BCE pass instead of doing it manually
llvm-svn: 3908
2002-09-24 15:43:56 +00:00
Chris Lattner
49588769e0 - Expose passinfo from BreakCriticalEdges pass so that it may be "Required"
by other passes.  Make BCE pass be in anonymous namespace now.

llvm-svn: 3907
2002-09-24 15:43:12 +00:00
Chris Lattner
4e11d9e5de Minor cleanups
llvm-svn: 3904
2002-09-24 00:09:26 +00:00
Chris Lattner
e62cdff96c Add new BreakCriticalEdges pass
llvm-svn: 3903
2002-09-24 00:08:39 +00:00
Chris Lattner
b6c408778a 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]

llvm-svn: 3897
2002-09-23 23:39:43 +00:00
Chris Lattner
a4184f9ab6 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.

llvm-svn: 3895
2002-09-23 23:00:46 +00:00
Chris Lattner
2a53929c5d * Fix bug: CorrelatedExprs/2002-09-23-PHIUpdateBug.ll
* Make sure "Changed" is updated correctly

llvm-svn: 3891
2002-09-23 20:06:22 +00:00
Chris Lattner
aecb825629 Insert resolved constants into the global map so they are reused correctly.
This bug was exposed linking the SPEC benchmark suite.

llvm-svn: 3888
2002-09-23 18:14:15 +00:00
Chris Lattner
5c6d487ee2 Don't insert a PHI node to merge "returns" from an inlined function if there
is only a single return from the function!

llvm-svn: 3878
2002-09-22 18:41:25 +00:00
Anand Shukla
b959e8559e Added checking threshold
llvm-svn: 3864
2002-09-20 16:44:35 +00:00
Anand Shukla
cf6e76fbff split retracing into a separate file
llvm-svn: 3809
2002-09-18 03:55:26 +00:00
Misha Brukman
e093f5cb9b Removed unnecessary #includes.
llvm-svn: 3802
2002-09-18 02:07:57 +00:00
Misha Brukman
6a2dc6b0ba Fixed typo.
llvm-svn: 3801
2002-09-18 00:42:45 +00:00
Chris Lattner
4396aee3a2 There is a #define in some header that conflicts with INFINITY, rename it.
llvm-svn: 3797
2002-09-17 23:46:33 +00:00
Chris Lattner
5ccb21f41d Fix bug: test/Regression/Transforms/InstCombine/2002-09-17-GetElementPtrCrash.ll
Thanks to Casey for finding it!

llvm-svn: 3783
2002-09-17 21:05:42 +00:00
Chris Lattner
99d6a46698 Fix FunctionInlining pass assertion failure:
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'

llvm-svn: 3768
2002-09-16 22:30:20 +00:00
Chris Lattner
5704e40ce0 Fix: test/Regression/LLC/badidx.c problem
llvm-svn: 3763
2002-09-16 18:32:33 +00:00
Vikram S. Adve
4bcec53ed7 Extract most of the transformation into an externally accessible
function -- DecomposeArrayRef(GetElementPtrInst* GEP) -- that can
be invoked on a single instruction at a time.

llvm-svn: 3755
2002-09-16 16:40:07 +00:00
Anand Shukla
86e49b7621 Incorporated changes in alloca and getElementPointer instruction
llvm-svn: 3733
2002-09-16 05:26:51 +00:00
Anand Shukla
0906acb26d Incorporated changes in alloca instruction
llvm-svn: 3732
2002-09-16 05:24:49 +00:00
Chris Lattner
56d9dfd0e0 Fix bug I introduced
llvm-svn: 3719
2002-09-14 19:33:16 +00:00
Misha Brukman
2e598f0092 Function.h is unnecessary when Module.h is included.
llvm-svn: 3716
2002-09-14 03:04:02 +00:00
Misha Brukman
dbe90c56ec Following Chris's advice, I'm pruning some unnecessary .h includes that I'm
noticing. Since Module includes Function, and eventually, BasicBlock and
GlobalVariable, the last three are unnecessary to be included directly.

llvm-svn: 3713
2002-09-14 02:06:53 +00:00
Chris Lattner
547be87c13 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.

llvm-svn: 3711
2002-09-13 22:28:50 +00:00
Chris Lattner
f820cab2ad Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.

llvm-svn: 3710
2002-09-13 22:28:45 +00:00
Chris Lattner
d6fed79df6 Fix bug I introduced with one of my previous changes.
Thanks fly out to Nick for noticing it!  :)

llvm-svn: 3691
2002-09-12 19:00:43 +00:00
Chris Lattner
fb017cb38c - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.

llvm-svn: 3682
2002-09-11 01:21:33 +00:00
Chris Lattner
18e3c4ff50 - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.

llvm-svn: 3681
2002-09-11 01:21:29 +00:00
Chris Lattner
5f4b79edaf Fix the last of the silly bugs I just introduced. :(
llvm-svn: 3674
2002-09-10 23:46:10 +00:00
Chris Lattner
62bd3a248c Fix bugs in previous checkins
llvm-svn: 3673
2002-09-10 23:31:28 +00:00
Chris Lattner
0b81131afc Fix bug in previous checkin
llvm-svn: 3672
2002-09-10 23:31:12 +00:00
Chris Lattner
5143d4a3b3 Add cannonicalization of shl X, 1 -> add X, X
llvm-svn: 3671
2002-09-10 23:04:09 +00:00
Chris Lattner
f2fa52fec2 Fix minor problems in previous checkin
llvm-svn: 3669
2002-09-10 22:52:51 +00:00
Chris Lattner
3b3e26bb63 Fix minor problems in previous checkin
llvm-svn: 3668
2002-09-10 22:52:49 +00:00
Chris Lattner
f2e4e61769 Clean up code due to auto-insert constructors
llvm-svn: 3666
2002-09-10 22:38:49 +00:00
Chris Lattner
37c3a1d80c Clean up code due to auto-insert constructors
llvm-svn: 3665
2002-09-10 22:38:47 +00:00
Chris Lattner
38203aa15a Clean up code
llvm-svn: 3664
2002-09-10 22:38:06 +00:00
Chris Lattner
acbd992f9d Fix bug: test/Regression/Transforms/LevelRaise/2002-09-10-PointerAdds.ll
llvm-svn: 3658
2002-09-10 19:42:53 +00:00
Chris Lattner
da9702a8a1 Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.

llvm-svn: 3656
2002-09-10 17:04:02 +00:00
Chris Lattner
5758cf6d77 Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.

llvm-svn: 3655
2002-09-10 17:03:06 +00:00
Chris Lattner
7787814c22 * Clean up code a little bit
* Fix bug: test/Regression/Transforms/IndVarsSimplify/2002-09-09-PointerIndVar.ll

llvm-svn: 3644
2002-09-10 05:24:05 +00:00
Chris Lattner
4f5abce7f6 Hack unneccesary now that shifts of pointers are no longer legal!
llvm-svn: 3640
2002-09-10 03:50:54 +00:00
Chris Lattner
f6a9e54dda Disallow creation of pointer typed shift instructions
llvm-svn: 3637
2002-09-09 20:25:21 +00:00
Chris Lattner
4b8ce3aed2 Factor silly code duplication out
llvm-svn: 3627
2002-09-08 21:47:54 +00:00
Chris Lattner
c1de581f8e Fix Bug: test/Regression/Transforms/InstCombine/2002-09-08-PointerShiftBug.ll
llvm-svn: 3626
2002-09-08 21:39:07 +00:00
Chris Lattner
c30029172a Minor simplification
llvm-svn: 3619
2002-09-08 18:55:04 +00:00
Chris Lattner
bd03f18e04 Initial checkin of Correlated Expression Elimination Pass
llvm-svn: 3599
2002-09-06 18:41:55 +00:00
Chris Lattner
bf38fcf5ee Fix file header to be accurate, instead of something I just copied and pasted.
llvm-svn: 3591
2002-09-06 03:59:56 +00:00
Chris Lattner
78a3ebaa18 Fix bug with critical edge splitting code where it wouldn't update PHI nodes
in the old destination block to indicate that the value flows from the new
edge splitting block, not from the original multi-successor block.

llvm-svn: 3590
2002-09-06 03:51:45 +00:00
Chris Lattner
c3c754062f Check in the implementation of critical edge detection and splitting
llvm-svn: 3588
2002-09-06 02:35:34 +00:00
Chris Lattner
3ce5b343c5 - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.

llvm-svn: 3574
2002-09-03 01:08:28 +00:00
Chris Lattner
904f214a13 - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.

llvm-svn: 3573
2002-09-03 01:07:35 +00:00
Chris Lattner
cd49f0ec5d Add constant prop & DIE to InstCombine, so it cleans up after itself
llvm-svn: 3568
2002-09-02 04:59:56 +00:00
Chris Lattner
bb8f1a072b - Implement SCCP of getelementptr instructions
- Implement SCCP of globals into ConstantExprs hopefully opening new
   opportunities for more SCCP.

llvm-svn: 3555
2002-08-30 23:39:00 +00:00
Chris Lattner
838248b35a - Eliminate the last traces of the 'analysis' namespace
llvm-svn: 3550
2002-08-30 22:53:53 +00:00
Chris Lattner
a146c9e769 Really minor cleanups
llvm-svn: 3549
2002-08-30 22:53:30 +00:00
Chris Lattner
b0cbcfd5e4 - GCSE now no longer counts instructions not removed (due to no common
dominator as being removed)
  - GCSE now uses new Value #'ing interface, instead of dealing with AA itself
  - GCSE worklist implementation much simpler, class cleaned up.

llvm-svn: 3533
2002-08-30 20:22:29 +00:00
Chris Lattner
66b1127636 - instcombine demorgan's law: and (not A), (not B) == not (or A, B)
llvm-svn: 3495
2002-08-23 18:32:43 +00:00
Chris Lattner
9f18db8156 Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3488
2002-08-22 23:37:24 +00:00
Chris Lattner
20b85d96e4 Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3487
2002-08-22 23:37:20 +00:00
Chris Lattner
969c616d51 Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore

llvm-svn: 3485
2002-08-22 22:49:05 +00:00
Chris Lattner
65920fff34 *** empty log message ***
llvm-svn: 3483
2002-08-22 22:48:32 +00:00
Chris Lattner
8b8d72c1f2 Add capability of using pointer analysis to LICM
llvm-svn: 3478
2002-08-22 21:39:55 +00:00
Chris Lattner
5addf774a3 Remove long obsolete comments
llvm-svn: 3476
2002-08-22 21:25:54 +00:00
Chris Lattner
18826b07fe Instcombine PHI's of the form %PN = phi PN, X into X and
%PN = phi PN, PN, PN into 0 (because the phi must not be reachable)

llvm-svn: 3470
2002-08-22 20:22:01 +00:00
Chris Lattner
5b94b874d6 Convert GCSE pass to use new alias analysis infrastructure
llvm-svn: 3463
2002-08-22 18:24:48 +00:00
Chris Lattner
59e4067423 Do not generate load/store instructions with indexing.
llvm-svn: 3461
2002-08-22 16:41:31 +00:00
Chris Lattner
c4bd846e84 - Split Dominators.h into Dominators.h & PostDominators.h
llvm-svn: 3432
2002-08-21 23:43:50 +00:00
Chris Lattner
9c09c6a306 Do not generate loads/stores with indexing
llvm-svn: 3422
2002-08-21 22:11:33 +00:00
Chris Lattner
c3bf7eea0e Remove extraneous #includes
llvm-svn: 3421
2002-08-21 22:11:14 +00:00
Chris Lattner
cddef868de Do not create load/stores with indexes
llvm-svn: 3420
2002-08-21 22:10:52 +00:00
Chris Lattner
a154f5fa97 Remove an optimization that isn't.
llvm-svn: 3419
2002-08-21 22:10:06 +00:00
Chris Lattner
6c83ee57c1 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3417
2002-08-21 17:09:49 +00:00
Chris Lattner
af538ea2c9 fixed bug: test/Regression/Linker/2002-08-20-ConstantExpr.ll
llvm-svn: 3412
2002-08-20 19:35:11 +00:00
Chris Lattner
ad92b604b5 - instcombine (~(a < b)) into (a >= b)
llvm-svn: 3406
2002-08-20 18:24:26 +00:00
Chris Lattner
22116975ce - implemented instcombine of phi (X, X, X) -> X
llvm-svn: 3397
2002-08-20 15:35:35 +00:00
Chris Lattner
289ad0e1fd - Made GlobalDCE worklist driven, making it more successful. Now can handle
cases like: test/Regression/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll

llvm-svn: 3381
2002-08-18 01:28:30 +00:00
Chris Lattner
04d2780d12 Promote getelementptr instructions to constexprs if we can.
llvm-svn: 3368
2002-08-17 22:21:59 +00:00
Chris Lattner
caaca8d4c9 Handle more cases of cast-of-cast in more general forms.
llvm-svn: 3347
2002-08-15 16:15:25 +00:00
Chris Lattner
83f92a7237 Implement capability to fold this:
uint %test4(int %A, int %B) {
        %COND = setlt int %A, %B                ; <bool> [#uses=1]
        %result = cast bool %COND to uint               ; <uint> [#uses=1]
        ret uint %result
}
into a single cast instruction.

llvm-svn: 3339
2002-08-14 23:21:10 +00:00
Chris Lattner
be85bafab2 Avoid creating 'load X, 0' instead of just 'load X'
This _trivial_ change causes GCSE and LICM to be much more effective at
hoisting loads.  Before it would not be able to eliminate 'load X' if there
was just a dominating 'load X, 0' because the expressions were not identical.

llvm-svn: 3337
2002-08-14 22:11:52 +00:00
Chris Lattner
80b897953e Avoid inserting an entry block unless we need it
llvm-svn: 3336
2002-08-14 21:35:02 +00:00
Chris Lattner
6a9d88347a Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.

llvm-svn: 3328
2002-08-14 18:24:09 +00:00
Chris Lattner
760f32d641 Fix bug introduced in last checkin due to CastInst not being visible
llvm-svn: 3327
2002-08-14 18:22:19 +00:00
Chris Lattner
980bf4b44d Remove support for NOT instruction
llvm-svn: 3323
2002-08-14 18:18:02 +00:00
Chris Lattner
34a9a81756 Remove extra #includes
llvm-svn: 3322
2002-08-14 18:17:32 +00:00
Chris Lattner
c264beb7c5 Remove support for unary operators
llvm-svn: 3318
2002-08-14 17:53:45 +00:00
Chris Lattner
890adeb7a2 - Fix InstCombine pass to not generate or process NOT instructions
- Fixed testcases to not use them either.

llvm-svn: 3315
2002-08-14 17:51:49 +00:00
Chris Lattner
c8183d92e3 Remove support for NOT instruction
llvm-svn: 3313
2002-08-14 17:45:39 +00:00
Chris Lattner
b6a04772b5 - Rename ConstantGenericIntegral -> ConstantIntegral
llvm-svn: 3300
2002-08-13 17:50:24 +00:00
Chris Lattner
a6ba1b74ac * Factor a bunch of code by using ReplaceInstUsesWith
* Move isMaxValue, isMinValue, isAllOnesValue to Constants.h

llvm-svn: 3290
2002-08-12 21:17:25 +00:00
Chris Lattner
0a51808266 New functionality for instcombine:
* New ReplaceInstUsesWith function to factor out tons of common code
     This needs to be used more in the future still, but it's a good start
   * New InsertNewInstBefore to allow multi-instruction replacements
   * Change getMaxValue functions to isAllOnesValue function, which doesn't
     have to CREATE/lookup a new constant.  Also the name is accurate
   * Add new isMaxValue, isMinValue, isMaxValueMinusOne, isMinValuePlusOne
     functions:  This should be moved to Constant* classes eventually
   * Implement xor X, ALLONES -> not X
   * Fold ALL setcc's of booleans away
   * Handle various SetCC's for integers against values at the end of their
     ranges, possibly off by one.  This implements the setcc-strength-reduce.ll
     testcase.

llvm-svn: 3286
2002-08-09 23:47:40 +00:00
Chris Lattner
62be99967a Initial checkin of the "Hello World" Pass.
llvm-svn: 3266
2002-08-08 20:10:38 +00:00
Chris Lattner
a21e315db4 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3265
2002-08-08 19:01:30 +00:00
Chris Lattner
91d4742562 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3264
2002-08-08 19:01:28 +00:00
Chris Lattner
62fb7f0304 Remove extraneous #includes
llvm-svn: 3262
2002-08-08 19:00:34 +00:00
Vikram S. Adve
bbe47f2e7d Eliminate cast instructions: use only GEPs in decomposed sequence.
Don't decompose if there are 2 indices with 0 as first index.
Compute Changed flag correctly in runOnBasicBlock().

llvm-svn: 3233
2002-08-03 13:21:15 +00:00
Chris Lattner
c840f0ec2a Fix bug: test/Regression/Transforms/InstCombine/2002-08-02-CastTest.ll
Implement feature: Cast's can now be converted to bitwise AND expressions.

llvm-svn: 3225
2002-08-02 20:00:25 +00:00
Chris Lattner
5d9be21256 * Cleanups of instcombine
- Reenable gep (gep x) -> x
   - Make instcombine do dead instruction elimination where it's really
     easy.  Now visitors don't have to ensure they aren't not processing
     dead instructions.

llvm-svn: 3222
2002-08-02 19:29:35 +00:00
Chris Lattner
b55222222e Fix bug: test/Regression/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
llvm-svn: 3215
2002-08-02 18:06:01 +00:00
Chris Lattner
b630b06f0d Remove unneccesary #inlcude
llvm-svn: 3200
2002-08-01 20:01:02 +00:00
Chris Lattner
b1792282eb Implement the other half of a feature advertised by OperandConvertableToType.
This fixes bug: test/Regression/Transforms/LevelRaise/2002-07-31-AssertionFailure.ll

llvm-svn: 3193
2002-07-31 22:31:34 +00:00
Chris Lattner
f8ca791c68 * Indent class into anonymous namespace, filling up the diff with garbage
* Internalize global variables with initializers
* Add new stat to track global variable internalization
* Only count functions that were not internal before in internalized function
  count

llvm-svn: 3163
2002-07-30 19:48:44 +00:00
Chris Lattner
12b9a2a7e6 Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr

llvm-svn: 3160
2002-07-30 18:54:22 +00:00
Chris Lattner
902619d2f1 Remove FIXME's that aren't really needed after all.
llvm-svn: 3158
2002-07-30 16:38:54 +00:00
Chris Lattner
4d05134df0 Fix bug with last patch which would occur when a call returned void and we
attempted to assign it a name.

llvm-svn: 3142
2002-07-30 02:42:49 +00:00
Chris Lattner
1980b35509 * Make sure the resolved function call instructions get the name from the
old call instruction
* Implement conversion of return values for calls.  This fixes bug:
   test/Regression/Transforms/FunctionResolve/retmismatch3.ll

llvm-svn: 3140
2002-07-30 00:50:49 +00:00
Chris Lattner
b9052f081a * Fix bug: test/Regression/Transforms/ADCE/2002-07-17-AssertionFailure.ll
which was caused by us not running the "drop references of dead
  instructions" code when there were no basic blocks that were dead.

  We still don't want to do some of the stuff we do if there are dead
  basic blocks, but we DO want to drop references of dead instructions,
  so we factor the common code out to a new method.

llvm-svn: 3137
2002-07-30 00:22:34 +00:00
Chris Lattner
72b8a38a26 Add code to ensure that no PHI nodes are left laying around with their
arguments dropped.  This fixes bug:
   test/Regression/Transforms/ADCE/2002-07-17-PHIAssertion.ll

llvm-svn: 3134
2002-07-29 23:40:46 +00:00
Chris Lattner
078c1024c0 Implement a new RemoveSuccessor function
llvm-svn: 3131
2002-07-29 22:32:08 +00:00
Chris Lattner
5aef91b716 Fix bug: test/Regression/Transforms/ADCE/2002-07-29-Segfault.ll
llvm-svn: 3129
2002-07-29 22:31:39 +00:00
Chris Lattner
2f7ce877c5 Allow folding of basic blocks that have PHI nodes in them, fixing "bug":
test/Regression/Transforms/SimplifyCFG/2002-06-24-PHINode.ll

llvm-svn: 3128
2002-07-29 21:26:30 +00:00
Chris Lattner
ec2780457d * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.

llvm-svn: 3116
2002-07-27 01:12:17 +00:00
Chris Lattner
3f47f1065b * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.

llvm-svn: 3115
2002-07-27 01:12:15 +00:00
Chris Lattner
7a9eb848cd * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3113
2002-07-26 21:12:46 +00:00
Chris Lattner
b934722f1b * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3112
2002-07-26 21:12:44 +00:00
Chris Lattner
ec1a192b16 *** empty log message ***
llvm-svn: 3105
2002-07-26 18:40:14 +00:00
Chris Lattner
05fe67c0d2 *** empty log message ***
llvm-svn: 3075
2002-07-25 06:17:51 +00:00
Chris Lattner
0702eb18e6 *** empty log message ***
llvm-svn: 3072
2002-07-24 22:40:39 +00:00
Chris Lattner
4a9e674077 Eliminate several include/llvm/Transforms/IPO/*.h files, moving their contents into IPO.h
llvm-svn: 3043
2002-07-24 17:12:05 +00:00
Chris Lattner
921e366a5c Merge ChangeAllocations into scalar.h
llvm-svn: 3038
2002-07-23 22:04:17 +00:00
Chris Lattner
176a67ce61 Rename header
llvm-svn: 3037
2002-07-23 22:04:02 +00:00
Chris Lattner
46077f4e0f Cleanup and simplify code
llvm-svn: 3036
2002-07-23 22:03:41 +00:00
Chris Lattner
ac78173ee0 Incorporate ConstantMerge.h into IPO.h
llvm-svn: 3035
2002-07-23 19:57:40 +00:00
Chris Lattner
38adabd0a1 Rename LevelChange.h to RaisePointerReferences.h
llvm-svn: 3034
2002-07-23 19:57:08 +00:00
Chris Lattner
c482880f9e *** empty log message ***
llvm-svn: 3016
2002-07-23 18:06:35 +00:00
Chris Lattner
606421d005 * Remove getPassName implementation
* Register all Passes

llvm-svn: 3015
2002-07-23 18:06:30 +00:00