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