1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

1883 Commits

Author SHA1 Message Date
Vikram S. Adve
e6c5ceeede Fix two resource names.
llvm-svn: 3443
2002-08-22 02:58:57 +00:00
Vikram S. Adve
098c5d67ba Add AsmPrinter::ConstantExprToString, which writes out a ConstantExpr
as an expression.

llvm-svn: 3442
2002-08-22 02:58:36 +00:00
Vikram S. Adve
39210a39ad Eliminate bool, boolreg and boolconst nonterminals, and just use
reg and Constant instead.

llvm-svn: 3441
2002-08-22 02:56:10 +00:00
Vikram S. Adve
dae1fe230e Change rules for Not, since it is now implemented as Xor(reg,11..1).
Eliminate bool, boolreg and boolconst nonterminals, and just use
reg and Constant instead.

llvm-svn: 3440
2002-08-22 02:55:21 +00:00
Chris Lattner
1ae38466e6 - Fighting with linking problem due to removing the ::ID elements. Now the
implementation .cpp files for analyses are not being included into gccas
    and friends because it is linking to the .a file and there is no explicit
    symbol reference to bring in the .o file.  The new IncludeFile hack is the
    result.

llvm-svn: 3436
2002-08-21 23:51:51 +00:00
Chris Lattner
0b6940f8c4 - Fix asmparser and bytecode reader to not generate loads/stores with idxs
Now an obnoxious warning is emitted to discourage usage.  Eventually
    support will be removed.

llvm-svn: 3435
2002-08-21 23:51:21 +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
65c79aaf22 Emit an obnoxious warning message for bytecode that includes load/store
instructions that use indexing.  Convert them transparently into a pair
of instructions.

llvm-svn: 3431
2002-08-21 22:55:27 +00:00
Chris Lattner
3597405d6d Remove debugging code accidentally checked in.
llvm-svn: 3430
2002-08-21 22:49:31 +00:00
Chris Lattner
02221dc679 - Implement the new AnalysisGroup feature, neccesary for Value#ing and pointer analysis
llvm-svn: 3426
2002-08-21 22:17:09 +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
b90f78e2b3 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3416
2002-08-21 17:09:45 +00:00
Chris Lattner
ae2d7ffd42 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3415
2002-08-21 17:09:15 +00:00
Chris Lattner
a63cce4e99 - Eliminate the need for analyses to expose an ::ID member.
llvm-svn: 3414
2002-08-21 17:08:37 +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
6c2d688d20 Sort -time-passes report first by user+system, then by Wall clock time.
llvm-svn: 3407
2002-08-20 18:47:53 +00:00
Chris Lattner
ad92b604b5 - instcombine (~(a < b)) into (a >= b)
llvm-svn: 3406
2002-08-20 18:24:26 +00:00
Chris Lattner
0d58102c1c Add new SetCondInst::getInverseCondition() method.
llvm-svn: 3405
2002-08-20 18:17:12 +00:00
Chris Lattner
a477df934f This case JUST handles constantpointer nulls, not all pointers.
llvm-svn: 3402
2002-08-20 17:02:48 +00:00
Chris Lattner
5578696d40 Fix bug: 2002-08-20-UnnamedArgument.c
llvm-svn: 3401
2002-08-20 16:55:48 +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
69a443b356 Implement ConstantExprs in CWriter
llvm-svn: 3394
2002-08-19 23:09:46 +00:00
Chris Lattner
ddd1d61b21 Incorporate calcTypeNameVar into CWriter class, fixing
test/Regression/CBackend/2002-08-19-FunctionPointer.c in the process

llvm-svn: 3392
2002-08-19 22:17:53 +00:00
Chris Lattner
b6818687da Output forward definitions of global vars to handle recursive intializers correctly.
llvm-svn: 3391
2002-08-19 21:48:40 +00:00
Chris Lattner
fc62e1bdb1 - Change constant printing to be better integrated with the rest of the
CWriter class.  Write directly to stream instead of building a big
      string, then writing it out.
    - Implement printing of ConstantPointerRefs

llvm-svn: 3389
2002-08-19 21:32:41 +00:00
Chris Lattner
85290b6ab3 Add missing space
llvm-svn: 3387
2002-08-19 20:42:12 +00:00
Chris Lattner
ebf7d3b8ff Fix bug: test/Regression/Assembler/2002-08-19-BytecodeReader.llx
llvm-svn: 3384
2002-08-19 16:48:21 +00:00
Chris Lattner
fe91f23c6d Fix the -time-passes option to not print NaN when there is zero execution time
llvm-svn: 3382
2002-08-19 15:43:33 +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
45aae6cd96 - ConstantPointerRefs are now automatically removed from the module table
when they are destroyed, which makes Constant::destroyConstant an actually
    useful external interface.  Expose these methods publicly.
  - Implement destroyConstant on ConstPointerNull so that destroyConstant can
    be used on any derived type constant safely.

llvm-svn: 3379
2002-08-18 00:40:04 +00:00
Chris Lattner
8cc9a599b5 Turn off a debugging optimization that just slows bytecode reading down
llvm-svn: 3377
2002-08-18 00:38:32 +00:00
Chris Lattner
143e810ca9 Add Module::dump() method
llvm-svn: 3375
2002-08-17 23:32:47 +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
31188e9d7b Fix stupid oversight of missing #include.
llvm-svn: 3367
2002-08-17 22:02:41 +00:00
Chris Lattner
f3d49adf85 - Finally nailed: test/Regression/Assembler/2002-08-16-ConstExprInlined.llx
- ParseConstantPool was resolving reference to value using the function
      slot # instead of the global slot #.
  - Bytecode reader changes:
    - Remove the failure<> template from Bytecode Reader
    - Remove extraneous #includes
    - s/method/function/ a bit
    - Eliminate the fwdRefs class that just added abstraction where it was not
      needed, making things more complex.
    - Use a vector instead of a list for function signatures.

llvm-svn: 3366
2002-08-17 22:01:27 +00:00
Chris Lattner
e63ef1c3ab Changed parser to always use parenthesis on ConstExprs to be consistent
llvm-svn: 3363
2002-08-16 21:17:11 +00:00
Chris Lattner
a2b28689a9 - Remove unused STRING token from lexer & parser
- Changed parser to always use parenthesis on ConstExprs to be consistent
  - Parser now passes TRUE and FALSE tokens as a special case of the ConstExpr
    machinery instead of a special case of constant int stuff
  - Fix the AsmParser to use ValueRef ::= ConstExpr, and remove
    ResolvedVal ::= ConstExpr this allows constexprs to be used in PHI nodes

llvm-svn: 3362
2002-08-16 21:14:40 +00:00
Chris Lattner
0d1bc11665 Write constexpr casts using the cast X to Y notation, not using the implicit
type result

llvm-svn: 3354
2002-08-15 19:37:43 +00:00
Chris Lattner
7cd8403f2b Parse const expr cast instruction the same way the instruction is formed
llvm-svn: 3353
2002-08-15 19:37:11 +00:00
Chris Lattner
8c5c0b9560 Move ConstExpr production to unify ConstVal stuff
llvm-svn: 3351
2002-08-15 18:17:28 +00:00
Chris Lattner
971fa225af Fix bug: test/Regression/Assembler/2002-08-15-UnresolvedGlobalReference.ll
llvm-svn: 3350
2002-08-15 17:58:33 +00:00
Chris Lattner
4a542aeb38 Simplify the code
llvm-svn: 3348
2002-08-15 16:15:36 +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
Vikram S. Adve
21b0deb4ab Unary Not (boolean and bitwise) is no longer a separate LLVM instruction
but is instead implemented with XOR.  Note that the InstrForest opLabels
for Not and BNot remain the same, i.e., the XOR is recognized and
represented as a (boolean or bitwise) Not when building the instruction
trees.  But these tree nodes are now binary, not unary.

llvm-svn: 3343
2002-08-15 14:19:22 +00:00
Vikram S. Adve
5e22d4f669 Revise code generation for unary Not (boolean and bitwise), which is
no longer a separate instruction but is instead implemented with XOR.

llvm-svn: 3342
2002-08-15 14:17:37 +00:00
Vikram S. Adve
c66b996e40 Added more helper functions for binary instructions emulating
unary Neg and Not: isNeg, isNot, getNegArgument, and getNotArgument.

llvm-svn: 3341
2002-08-15 14:15:48 +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
d909e03b2e Remove support for unary operators.
llvm-svn: 3326
2002-08-14 18:19:46 +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
119695e390 Remove support for NOT instruction
llvm-svn: 3320
2002-08-14 18:00:52 +00:00
Chris Lattner
c264beb7c5 Remove support for unary operators
llvm-svn: 3318
2002-08-14 17:53:45 +00:00
Chris Lattner
794511bf40 Implement two constructor functions for "unary" instructions
llvm-svn: 3317
2002-08-14 17:52:27 +00:00
Chris Lattner
9f528df0ad Remove support forNOT instruction
llvm-svn: 3316
2002-08-14 17:52:06 +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
ed328517aa AsmParser turns 'not' instructions into 'xor' instructions now.
llvm-svn: 3309
2002-08-14 17:12:33 +00:00
Chris Lattner
26186786e1 Return null on failure, instead of aborting.
llvm-svn: 3308
2002-08-14 17:12:13 +00:00
Vikram S. Adve
87928f2098 Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.

llvm-svn: 3306
2002-08-14 16:52:58 +00:00
Chris Lattner
3d013e4c40 Minor change to make lli print out characters numerically as well as symbolically
llvm-svn: 3303
2002-08-13 20:45:11 +00:00
Vikram S. Adve
19b35e6904 Bug fix in TargetData::getIndexedOffset: We were using the pointer
type instead of the element type for the element size for arrays.

llvm-svn: 3302
2002-08-13 18:17:56 +00:00
Vikram S. Adve
74af31c71e Several bug fixes in casting to signed int values.
llvm-svn: 3301
2002-08-13 18:04:08 +00:00
Chris Lattner
b6a04772b5 - Rename ConstantGenericIntegral -> ConstantIntegral
llvm-svn: 3300
2002-08-13 17:50:24 +00:00
Chris Lattner
b639abc322 - Rename ConstantGenericIntegral -> ConstantIntegral
- Add new methods to ConstantIntegral: getMaxValue, getMinValue,
   getAllOnesValue

llvm-svn: 3299
2002-08-13 17:50:20 +00:00
Vikram S. Adve
5f028d4787 Handle small unsigned results correctly by clearing high bits.
Bug fixes in casting to signed int values.

llvm-svn: 3297
2002-08-13 17:40:54 +00:00
Brian Ensink
8395e5b203 Build correctly in the face of /shared.
-Chris

llvm-svn: 3296
2002-08-12 22:09:44 +00:00
Chris Lattner
4c524344b9 - Clean up interface to Sparc register handling a bit:
- Eliminate Sparc*Order classes, moving contents to Sparc*Class classes
   - get register name methods now return const char * const pointers instead
     of std::string's.
   - Added file header comments to SparcRegClassInfo.(cpp|h)
   - Moved BIG constant arrays out of SparcRegClassInfo.h, into
     SparcRegInfo.cpp.  This should allow a LOT of std::string constructors to
     not have to be called.

llvm-svn: 3295
2002-08-12 21:25:05 +00:00
Chris Lattner
4fbca59155 - Added a new superclass of ConstantBool/ConstantInt: ConstantGenericIntegral
- Moved InstCombine: isMaxValue, isMinValue, isAllOnesValue to Constants.h

llvm-svn: 3293
2002-08-12 21:21:21 +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
ba82fa7aeb Remove some extraneous #includes
llvm-svn: 3289
2002-08-12 20:24:46 +00:00
Chris Lattner
f439d24c89 Changes to make GlobalValueRefMap not derive from std::map.
llvm-svn: 3288
2002-08-12 20:23:29 +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
c159d739a5 *** empty log message ***
llvm-svn: 3282
2002-08-09 22:52:08 +00:00
Chris Lattner
d2d8928f1b UnaryOperator::create should take a name just like BinaryOperator::create
llvm-svn: 3279
2002-08-09 21:39:38 +00:00
Chris Lattner
8a4787495a * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3278
2002-08-09 20:08:06 +00:00
Chris Lattner
4d9fadc44a * Removed extraneous #includes
* Fixed file headers to be consistent with the rest of LLVM
* Other minor fixes

llvm-svn: 3277
2002-08-09 20:08:03 +00:00
Chris Lattner
c95ce32146 We are using std::vector, so remove extraneous namespace prefixes
llvm-svn: 3275
2002-08-09 20:05:34 +00:00
Chris Lattner
12af061d07 Very minor cleanups
llvm-svn: 3271
2002-08-09 18:55:18 +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
Chris Lattner
75f1e2a970 Minor changes to DEBUG()'s
llvm-svn: 3261
2002-08-07 21:41:11 +00:00
Chris Lattner
d9530f6734 Reorder #includes to be right
llvm-svn: 3260
2002-08-07 21:41:03 +00:00
Chris Lattner
811987ce5c Merge three loops into one.
llvm-svn: 3259
2002-08-07 21:39:48 +00:00
Chris Lattner
73ed86900d Fix breakage in the build
llvm-svn: 3258
2002-08-07 21:39:39 +00:00
Chris Lattner
a4b59e7f2b Simplify writing custom parsers.
llvm-svn: 3256
2002-08-07 18:36:37 +00:00
Mehwish Nagda
0517186a70 added Mapping and Function Pass
llvm-svn: 3251
2002-08-05 23:23:19 +00:00
Vikram S. Adve
5d16e242e1 Bug fix in CreateCodeToLoadConst(): use sign of dest, not operand,
in choosing how to create int-set instructions.

llvm-svn: 3248
2002-08-04 20:55:37 +00:00
Vikram S. Adve
9dd19151b8 Bug fix in TargetData::getIndexedOffset(): handle struct offset
after array offset correctly.  The type was not being updated for
array offsets!

llvm-svn: 3246
2002-08-04 20:52:39 +00:00
Vikram S. Adve
03a5ca5dcc Bug fix in SetOperandsForMemInstr: handle leading zeros correctly
when folding or not folding GEPs.

llvm-svn: 3245
2002-08-04 20:51:05 +00:00
Vikram S. Adve
3489677a7e Add function GetConstantValueAsUnsignedInt.
Fix 2 bugs in FoldGetElemChain so index vector is not modified
when no GEPs are folded in, and so a hasLeadingZero is computed
only for the last folded GEP, not the one after that if any.

llvm-svn: 3244
2002-08-04 20:49:49 +00:00