Commit Graph

29037 Commits

Author SHA1 Message Date
Chris Lattner 0fd2b9f5c0 GEP operands can't be bools
llvm-svn: 33125
2007-01-12 18:20:48 +00:00
Chris Lattner 7f6fac4bb5 Simplify code
llvm-svn: 33123
2007-01-12 18:15:09 +00:00
Reid Spencer 2759b18e5d Make a couple organizational changes. Type no longer derives from Value
(hasn't for ages) so move it up one level in the table of contents.
Type needs to be understood before Value so move it before Value. Make
the descriptions of types stand out a little more.  Add references to the
doxygen for the Type class.

llvm-svn: 33122
2007-01-12 17:26:25 +00:00
Devang Patel 0f08004ac0 Remove dead code.
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer b9e5d10cf7 Update documentation for arbitrary precision integers:
1. int -> i32
2. Describe the IntegerType class.
3. Correct the description of Type and its primitive type subclasses.
4. Document OpaqueType and PackedType a little better.

llvm-svn: 33120
2007-01-12 17:11:23 +00:00
Reid Spencer 07c9c68825 Fix a typo.
llvm-svn: 33118
2007-01-12 15:46:11 +00:00
Reid Spencer b20ef92e42 Regenerate.
llvm-svn: 33117
2007-01-12 07:28:27 +00:00
Reid Spencer 0879a87a0d Integer type names need 1 or more digits, not zero or more.
llvm-svn: 33116
2007-01-12 07:27:59 +00:00
Reid Spencer c87215900d Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Evan Cheng a557a0028d Comment.
llvm-svn: 33114
2007-01-12 07:25:16 +00:00
Reid Spencer 7a9c62baa6 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Chris Lattner 899a89b11b Fix persistent conflict madness by removing these from cvs.
llvm-svn: 33111
2007-01-12 05:35:13 +00:00
Reid Spencer cddc9dfe97 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer e4c7fcd1bd Update for changes in the IR. The ConstantIntegral, ConstantBool, and
ConstantInt classes were merged into just ConstantInt.

llvm-svn: 33107
2007-01-12 03:36:33 +00:00
Reid Spencer 36a1542bcb Update for changes in the assembly syntax. bool is replaced with i1.
llvm-svn: 33106
2007-01-12 03:35:51 +00:00
Evan Cheng 31cbddf28a Store default libgcc routine names and allow them to be redefined by target.
llvm-svn: 33105
2007-01-12 02:11:51 +00:00
Nick Lewycky ee32ee0250 If we know that it's a constant being casted, propagate through the cast
instruction. Doesn't work the other way though (can't recover bits that
have been truncated).

llvm-svn: 33104
2007-01-12 01:23:53 +00:00
Nick Lewycky 4a74a75bbb Clean up logic after ConstantBool removal.
llvm-svn: 33096
2007-01-12 00:02:12 +00:00
Devang Patel ad98d23f16 Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.

llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Reid Spencer 582db976d8 Don't remove the find_rule label from FLEX output. It is needed by some
versions of FLEX even through we don't use REJECT. Thanks to Jeff Cohen
for tracking this down.

llvm-svn: 33085
2007-01-11 21:40:25 +00:00
Devang Patel ac99eca428 Use getPassManagerType() instead of dynamic_cast.
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng bd23db9968 Remove unnecessary boolean type check.
llvm-svn: 33075
2007-01-11 14:38:17 +00:00
Zhou Sheng eb29b0bb6e Fixed a bug in ConstantInt::Inverted().
Modified comment of that method.

llvm-svn: 33074
2007-01-11 14:31:10 +00:00
Zhou Sheng 75b871fb1e For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Zhou Sheng 691b263e07 Fixed indentation.
llvm-svn: 33072
2007-01-11 10:33:26 +00:00
Reid Spencer 5656cad97d Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Reid Spencer 81accb5f08 Put in some needed \ at the end of lines!!!
llvm-svn: 33070
2007-01-11 06:51:56 +00:00
Chris Lattner 550a8f3760 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner 5e04332326 Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.

llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Nick Lewycky 5d6ede524a Quiet compiler warning. The only reason the function is marked virtual
is so that it can be called from inside a debugger.

llvm-svn: 33067
2007-01-11 02:38:21 +00:00
Nick Lewycky 2fc338f923 New predicate simplifier!
Please do not enable, there is still some known miscompile problem.

llvm-svn: 33066
2007-01-11 02:32:38 +00:00
Devang Patel 3b3f89900e Add PassManagerType enum.
llvm-svn: 33065
2007-01-11 01:10:25 +00:00
Reid Spencer 750f80e306 Avoid taking the address of a macro by checking to see if stdin is defined
or not. This allows DynamicLibrary.cpp to compile on Darwin.

llvm-svn: 33064
2007-01-11 00:35:10 +00:00
Reid Spencer 74bd036059 Implement better constant folding of unordered FCMP predicates.
llvm-svn: 33063
2007-01-11 00:25:45 +00:00
Devang Patel 15701b5c0d Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.

llvm-svn: 33062
2007-01-11 00:19:00 +00:00
Reid Spencer 1b2eeedd85 Allow LLI, in interpreter mode, to find stdin, stdout, and stderr. This is
a bit of a hack but it lets some of the llvm-test programs run.

llvm-svn: 33058
2007-01-10 19:50:43 +00:00
Reid Spencer c6c4fab067 Back out the last patch which is a nightly test killer. The assertion
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.

llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner 2d56715015 Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.

llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner 2cf85c7507 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Reid Spencer 69fb861b19 Change the file header name as this file was renamed.
llvm-svn: 33051
2007-01-10 04:17:32 +00:00
Reid Spencer 2972099ff1 Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.

llvm-svn: 33050
2007-01-10 04:16:17 +00:00
Chris Lattner 8571caa99b Fix a bug in heap-sra that caused compilation failure of office-ispell.
llvm-svn: 33043
2007-01-09 23:29:37 +00:00
Reid Spencer e3db84c6c2 Explain that bitcast can only cast a pointer to another pointer.
llvm-svn: 33041
2007-01-09 20:08:58 +00:00
Reid Spencer 1fc9be30ef For PR1099:
Invert the "isSigned" logic in calls to printType and printPrimitiveType.
We want variables to be declared unsigned by default so that signless
operators like + and - perform the unsigned operation that LLVM expects
by default. Parameters with the sext attribute will be declared signed and
signed instructions will case operand values to signed regardless of the
type of the variable. This passes all tests and fixes PR1099.

llvm-svn: 33039
2007-01-09 17:09:09 +00:00
Chris Lattner 04398e8d48 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner 721c213c0e Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!

llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner ea862a33d9 Split CreateSlot into two versions, one for globals and one for function-local
values

llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner 89e774efaa Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.

llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Reid Spencer bf38bf7143 For PR1099:
Partial fix for this PR. Default function parameters to signed integer, just
like everything else in CBE. The bug was caused by incorrectly introducing
parameter attributes feature by choosing "signed" parameter if the
SExtAttribute was specified. Howeer, if no attribute is specified, this
causes it to become unsigned which is incorrect. Reversing the logic so
that signedness is detected by "not ZExtAttribute" set fixes the issue.

This fixes 197.parser but there is more to do. Any comparison and possibly
other operators involving arguments may need to correctly cast the parameter
before its use, depending on the sign of the operator.

llvm-svn: 33034
2007-01-09 06:38:06 +00:00