1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

331 Commits

Author SHA1 Message Date
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
Chris Lattner
536cf1b13f * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
0c04e4d1ef Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.

llvm-svn: 2332
2002-04-27 03:15:45 +00:00
Chris Lattner
1e7147c9e9 * Change Constant::getNullConstant to Constant::getNullValue
* Add support for pool allocating array allocations of varying size

llvm-svn: 2329
2002-04-27 02:29:32 +00:00
Chris Lattner
078d292f4c Change Constant::getNullConstant to Constant::getNullValue
llvm-svn: 2323
2002-04-27 02:25:14 +00:00
Chris Lattner
039edb92f3 Programs that actually free memory were broken
llvm-svn: 2307
2002-04-18 22:11:30 +00:00
Chris Lattner
8e2b6edf87 Add a fixme so that we don't forget this is broken.
llvm-svn: 2298
2002-04-18 18:52:03 +00:00
Chris Lattner
a392a80a60 Significantly rework InstructionCombining to work better and to be cleaner.
We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.

llvm-svn: 2292
2002-04-18 17:39:14 +00:00
Chris Lattner
bb60c83409 Convert SCCP over to use InstVisitor instead of hand crafted switch
llvm-svn: 2286
2002-04-18 15:13:15 +00:00
Chris Lattner
b736829547 GEP instructions can never be constant propogated.
llvm-svn: 2284
2002-04-18 14:44:13 +00:00
Chris Lattner
5e7d6d8066 Store instructions always return void, so they never get a name
llvm-svn: 2283
2002-04-18 14:43:54 +00:00
Chris Lattner
eee0e3f1f7 Correctly transform dependant arguments, allowing the perimeter bm to work.
llvm-svn: 2282
2002-04-18 14:43:30 +00:00
Chris Lattner
04437c9749 Add casts for documentation
llvm-svn: 2272
2002-04-16 22:10:52 +00:00
Chris Lattner
68c032623c * Clean up the code a bit
* Allow structs with negative offsets.  This enables the em3d benchmark to
  be made typesafe.  In this case, the struct had an array as the first
  element, so a negative index was ok (the expr was -8 + 8x)

llvm-svn: 2271
2002-04-16 22:10:36 +00:00
Chris Lattner
c004e8f534 run an extra pass after a function has been transformed to eliminate
obviously duplicate loads of the pool base.

llvm-svn: 2255
2002-04-15 22:42:23 +00:00
Chris Lattner
1923a5cfaa Eliminate cast of same type instructions.
llvm-svn: 2251
2002-04-15 19:45:29 +00:00