Chris Lattner
7b20305ef9
Factor code out of TransformInternals into the Transform Utils library
...
llvm-svn: 2515
2002-05-07 18:09:15 +00:00
Chris Lattner
e817245564
Build Transforms Utils library
...
llvm-svn: 2514
2002-05-07 18:08:50 +00:00
Chris Lattner
d5477af051
Add code pulled out of TransformInternals.cpp, ConstProp.cpp, and DCE.cpp
...
llvm-svn: 2513
2002-05-07 18:07:59 +00:00
Chris Lattner
394781b660
* Convert InstWorkList to vector instead of set, because on big programs it
...
is empirically faster by a noticable margin, even though duplicates can
happen.
llvm-svn: 2511
2002-05-07 04:29:32 +00:00
Chris Lattner
4a830e1a4a
* Remove all cfg simplification stuff for a new cfg simplify pass (todo)
...
* Convert to worklist instead of iterative algorithm
llvm-svn: 2510
2002-05-07 04:24:11 +00:00
Chris Lattner
ca538273d4
Only do masking for unsigned values!
...
llvm-svn: 2504
2002-05-06 18:54:59 +00:00
Chris Lattner
66ff017174
* Eliminate dead code that should have been removed in last revision
...
* Convert main constant propogation pass to be worklist driven instead of
iterative.
* -constprop pass no longer "constant propogates" terminator instructions
- CFG is now preserved!
llvm-svn: 2502
2002-05-06 18:21:31 +00:00
Chris Lattner
24ebec1273
Handle X = phi Y --> X = Y
...
llvm-svn: 2501
2002-05-06 18:06:38 +00:00
Chris Lattner
910ca80941
* Use simplified interface to constant propogation stuff.
...
* Remove dead PHI case (which could not work due to getNumOperands rather than
getNumIncomingValues. This really belongs in InstCombine, anyway so we'll
move it there.
llvm-svn: 2497
2002-05-06 17:54:10 +00:00
Chris Lattner
b40c1bf6f7
Clean up ADCE by removing extraneous wrapper class
...
llvm-svn: 2494
2002-05-06 17:27:57 +00:00
Chris Lattner
c5279917bc
Combine not (not X) -> X
...
llvm-svn: 2493
2002-05-06 17:03:21 +00:00
Chris Lattner
24a94a50d8
Support more cases...
...
llvm-svn: 2490
2002-05-06 16:49:18 +00:00
Chris Lattner
24ebdf3f74
Add many more instruction combination simplifications
...
llvm-svn: 2484
2002-05-06 16:14:14 +00:00
Chris Lattner
ef7f8fc474
Merge blocks like this:
...
void "test3"(bool %T) {
br bool %T, label %BB1, label %BB1
BB1:
ret void
}
llvm-svn: 2472
2002-05-06 03:02:02 +00:00
Chris Lattner
d12eac0b1b
Implement constant propogation of shift instructions
...
llvm-svn: 2471
2002-05-06 03:01:37 +00:00
Chris Lattner
9606fd4830
Ok, really it only takes me 3 times to get this right!
...
Now use #if 0 instead of #ifdef 0
llvm-svn: 2448
2002-05-02 21:49:50 +00:00
Chris Lattner
de442f70ac
Oops, disable debugging code all the way. :)
...
llvm-svn: 2447
2002-05-02 21:47:40 +00:00
Chris Lattner
7d4f3ed1f2
* Finish the implementation of isEdgeFeasible this fixes bug:
...
test/Regression/Transforms/SCCP/2002-05-02-EdgeFailure.ll
* SCCP now preserves the CFG: It leaves conditional branches the way they
are in the program, not simplifying them. A seperate pass should eliminate
the potentially dead basic blocks and edges in the CFG.
llvm-svn: 2446
2002-05-02 21:44:00 +00:00
Chris Lattner
b30088a50d
* Enable SCCP debugging to be turned on with a simple change of #define
...
* Change worklist to a set so that duplicates cannot happen
* Add support for the invoke instruction
* Avoid marking store and free instructions as overdefined, since they
cannot produce a value anyway.
* Inline the OperandChangedState implementation
* Add isEdgeFeasible in preparation to fix a bug. Right now it behaves
exactly as before.
* Remove obsolete comment about constant pools
llvm-svn: 2445
2002-05-02 21:18:01 +00:00
Chris Lattner
28a8acc476
* Simplify the code by not bothering to name the folded constant
...
* Do not skip the instruction immediately after a folded instruction. This
was causing the testcase failure:
test/Regression/Transforms/SCCP/2002-05-02-MissSecondInst.ll
llvm-svn: 2443
2002-05-02 20:32:51 +00:00
Chris Lattner
6212dd5c08
ExprTypeConvert will already do this transformation, no need to specialize
...
it here.
llvm-svn: 2431
2002-05-02 17:38:55 +00:00
Chris Lattner
2c44e5bca3
Be a little more efficient, do not generate loads and stores with indices in them.
...
llvm-svn: 2430
2002-05-02 17:38:14 +00:00
Chris Lattner
66f5b12141
Fix bug: test/Regression/Transforms/LevelRaise/2002-05-02-BadCastElimination.ll
...
llvm-svn: 2429
2002-05-02 17:37:34 +00:00
Chris Lattner
b7df910c1a
* Add ability to eliminate a bunch of different cascading cast variations
...
* Allow elimination of getelementptr X, uint 0 (which is a noop)
llvm-svn: 2428
2002-05-02 17:06:02 +00:00
Chris Lattner
8a6104c3cb
Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
...
llvm-svn: 2423
2002-05-01 15:38:23 +00:00
Chris Lattner
5879b0928b
Remove unneccesary pass
...
llvm-svn: 2420
2002-04-30 20:52:49 +00:00
Chris Lattner
a6cb49c533
Add folding rules for mul X, 0 and mul X, 2
...
llvm-svn: 2417
2002-04-29 22:24:47 +00:00
Chris Lattner
5d1ac4dbc9
Significantly clean up SCCP pass. Now the two classes are merged and in
...
an anonymous namespace where they belong.
llvm-svn: 2415
2002-04-29 21:26:08 +00:00
Chris Lattner
48e73edf57
Range insertion now returns an iterator
...
llvm-svn: 2414
2002-04-29 21:25:34 +00:00
Chris Lattner
5d17e49ad5
Remove unused files: This is the old induction varaible cannonicalization
...
pass built on top of interval analysis
llvm-svn: 2411
2002-04-29 20:18:00 +00:00
Chris Lattner
4968cc38aa
Fix for problem when allocating something like this:
...
malloc(100-i);
llvm-svn: 2409
2002-04-29 20:09:21 +00:00
Chris Lattner
f5d07697e6
changes because iMemory.h no longer #includes DerivedTypes.h
...
This only requires Type.h anyway
llvm-svn: 2405
2002-04-29 18:48:30 +00:00
Chris Lattner
cfc512e714
Eliminate dead global variables
...
llvm-svn: 2400
2002-04-29 18:13:11 +00:00
Chris Lattner
96e0c48175
Eliminate duplicate or unneccesary #include's
...
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
3909059b6a
Remove broken assertion.
...
llvm-svn: 2396
2002-04-29 16:20:25 +00:00
Chris Lattner
589debc4ba
Add new optional getPassName() virtual function that a Pass can override
...
to make debugging output a lot nicer.
llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner
56828a18c4
More cleanups
...
llvm-svn: 2392
2002-04-29 01:58:47 +00:00
Chris Lattner
a8688d69c5
Code cleanups
...
llvm-svn: 2391
2002-04-29 01:22:55 +00:00
Chris Lattner
ec70d92221
Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
...
llvm-svn: 2386
2002-04-28 21:27:06 +00:00
Chris Lattner
321a8cf4ba
Split ConstantVals.h into Constant.h and Constants.h
...
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
50a089867d
Eliminate the PromoteInstance class, incorporating it into the PromotePass
...
class.
llvm-svn: 2375
2002-04-28 19:12:38 +00:00
Chris Lattner
b8ade8715e
Eliminate visited, CurrentValue, and WriteSets as instance variables of
...
PromoteInstance. Make them local variables that are passed around as
appropriate. Especially in the case of CurrentValue, this makes the
code simpler.
llvm-svn: 2374
2002-04-28 18:54:01 +00:00
Chris Lattner
1d9e63dca0
* Fix bug: test/Regression/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
...
* Minor cleanup that was missed in last patch
llvm-svn: 2373
2002-04-28 18:39:46 +00:00
Chris Lattner
246083577b
This huge changeset is a strictly cleanup change
...
Bugfixes will come in the next revision so that the diff is obvious.
llvm-svn: 2372
2002-04-28 18:27:55 +00:00
Chris Lattner
07fe96ca98
Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
...
to the global namespace
llvm-svn: 2370
2002-04-28 16:21:30 +00:00
Chris Lattner
e5d8bd9baf
Be careful not to make "external" function internal
...
llvm-svn: 2363
2002-04-28 05:48:34 +00:00
Chris Lattner
23e713d49d
Initial checkin of new "Internalize" pass for GCCLD
...
llvm-svn: 2362
2002-04-28 05:43:27 +00:00
Chris Lattner
0bd57e6e99
Initial checkin of simple&fast SSA based GCSE algorithm
...
llvm-svn: 2338
2002-04-28 00:47:11 +00:00
Chris Lattner
741453dd60
Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
...
const BasicBlocks
llvm-svn: 2337
2002-04-28 00:15:57 +00:00
Chris Lattner
2f0ee1833d
s/Method/Function
...
llvm-svn: 2336
2002-04-27 07:27:19 +00:00