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
Chris Lattner
6f818d501c
Fix compilation problem. IsIndexZero doesn't exist, use IsZero instead.
...
llvm-svn: 3243
2002-08-03 20:57:38 +00:00
Vikram S. Adve
6316385f3e
Simplified handling of array indexes in SetMemOperands_Internal.
...
llvm-svn: 3236
2002-08-03 13:48:21 +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
5f2b5e70e0
Fix problem where lli would not print out a 64 bit value when the client code
...
uses the modifier "%ld". Now lli passes off "%lld" to the underlying runtime
library in this case.
llvm-svn: 3230
2002-08-02 23:08:32 +00:00
Chris Lattner
64e62f9a50
Fix one real nasty bug
...
llvm-svn: 3227
2002-08-02 22:06:04 +00:00
Chris Lattner
86b1459fdb
Fix lli with no arguments
...
llvm-svn: 3226
2002-08-02 21:51:29 +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
e980c93ebc
Implement dominator checking in the verifier, so that we check that all
...
defintiions dominate their uses
llvm-svn: 3214
2002-08-02 17:37:08 +00:00
Chris Lattner
7c8f92eacc
Fix bug: test/Regression/Other/2002-08-02-DomSetProblem.ll
...
llvm-svn: 3213
2002-08-02 16:51:27 +00:00
Chris Lattner
829a3f1c3a
Split dominance calculation and post dominance calculation stuff
...
Dominance calculation goes to VMCore library to be used by Verifier.
llvm-svn: 3210
2002-08-02 16:43:03 +00:00
Chris Lattner
b630b06f0d
Remove unneccesary #inlcude
...
llvm-svn: 3200
2002-08-01 20:01:02 +00:00
Chris Lattner
41280182a6
Enhance -time-passes to be more detailed and useful
...
llvm-svn: 3199
2002-08-01 19:33:09 +00:00
Vikram S. Adve
02b632401c
Bug fix: incorrect SAVE instruction when using register for stack size.
...
llvm-svn: 3198
2002-08-01 14:26:11 +00:00
Chris Lattner
8adb533609
Fix bug: test/Regression/Assembler/2002-07-31-SlashInString.llx
...
llvm-svn: 3195
2002-07-31 23:56:44 +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
Vikram S. Adve
836a811861
Just improved comments and assertions.
...
llvm-svn: 3191
2002-07-31 21:13:31 +00:00
Vikram S. Adve
d5185db5e8
Add a missing case: converting float/double to unsigned integer types.
...
llvm-svn: 3188
2002-07-31 21:01:34 +00:00
Chris Lattner
303fa649e3
Changes to be GCC3.1 friendly
...
llvm-svn: 3186
2002-07-31 19:32:12 +00:00
Chris Lattner
24f5355b1f
*** empty log message ***
...
llvm-svn: 3185
2002-07-31 19:32:01 +00:00