1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

478 Commits

Author SHA1 Message Date
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
Chris Lattner
17d972ce72 * Cleanup the pass a bit more, making it more object oriented.
* Split the two behaviors of the InsertTraceCode class into two subclasses
* Register Passes

llvm-svn: 3014
2002-07-23 18:04:15 +00:00
Chris Lattner
670d7d06fe * Break the two different behaviors of SimpleStructMutation into two subclasses
* Register the passes

llvm-svn: 3013
2002-07-23 18:03:11 +00:00
Chris Lattner
b059058c80 * Make the ctor take a TargetData even though it's not using it yet
* Register the pass

llvm-svn: 3012
2002-07-23 18:02:23 +00:00
Chris Lattner
bdb978fa79 * Remove lots of dead stuff
* Register Pass

llvm-svn: 3011
2002-07-23 18:01:39 +00:00
Chris Lattner
24bcbdd155 *** empty log message ***
llvm-svn: 3002
2002-07-23 17:52:38 +00:00
Chris Lattner
4d05cb01b1 Hide extra argument
llvm-svn: 2986
2002-07-22 02:17:27 +00:00
Chris Lattner
99ad379582 *** empty log message ***
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Anand Shukla
60f4c16199 comeented out debug printing
llvm-svn: 2980
2002-07-21 09:41:18 +00:00
Anand Shukla
4c822342bf minor corrections
llvm-svn: 2971
2002-07-18 20:56:47 +00:00
Chris Lattner
c459d57fe3 Seperate stats for DCE'd functions and vars
llvm-svn: 2961
2002-07-18 06:40:04 +00:00
Chris Lattner
13b8b7c8fe *** empty log message ***
llvm-svn: 2959
2002-07-18 04:43:20 +00:00
Chris Lattner
1abd637044 Only functions with external linkage can be resolved to function declarations.
This change fixes programs that have multiple functions named the same thing,
where are least one of them is static/internal.

llvm-svn: 2954
2002-07-18 03:01:24 +00:00
Chris Lattner
d703fa0041 * Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec

llvm-svn: 2953
2002-07-18 02:31:03 +00:00
Chris Lattner
3710b0d6d1 * Correctly get prototype for void*malloc(size_t)
llvm-svn: 2951
2002-07-18 00:18:01 +00:00