Commit Graph

16713 Commits

Author SHA1 Message Date
Chris Lattner
ef3baf0979 don't discriminate against bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:28:58 +00:00
Chris Lattner
05b30d840a remove unneeded special cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33127 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:23:49 +00:00
Chris Lattner
0bb38313ae GEP operands can't be bools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:20:48 +00:00
Chris Lattner
a875df3aaa Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:15:09 +00:00
Devang Patel
a0dd987916 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 17:23:48 +00:00
Reid Spencer
4db2063eee Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:28:27 +00:00
Reid Spencer
c25a9b9102 Integer type names need 1 or more digits, not zero or more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:27:59 +00:00
Reid Spencer
15ee935fc5 Always write 1 bit integers as i1 not "bool".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:25:20 +00:00
Evan Cheng
e77d10df41 Comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33114 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:25:16 +00:00
Reid Spencer
a54b7cbd45 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
579dca12c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 04:24:46 +00:00
Evan Cheng
56966225d1 Store default libgcc routine names and allow them to be redefined by target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33105 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 02:11:51 +00:00
Nick Lewycky
28c5b1544a 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 01:23:53 +00:00
Nick Lewycky
c2a7d097f9 Clean up logic after ConstantBool removal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 00:02:12 +00:00
Devang Patel
36bcb82c3f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 22:15:30 +00:00
Devang Patel
6b9420e943 Use getPassManagerType() instead of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 19:59:06 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
34dceb4757 Remove unnecessary boolean type check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 14:38:17 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Zhou Sheng
057809ac1c Fixed indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 10:33:26 +00:00
Reid Spencer
11b910c71f Shut up a warning about signed/unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 07:58:19 +00:00
Chris Lattner
ac618e6a9d simplify some logic further
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 04:30:21 +00:00
Chris Lattner
22379bc7bb Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 03:54:27 +00:00
Nick Lewycky
bc00fec835 Quiet compiler warning. The only reason the function is marked virtual
is so that it can be called from inside a debugger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 02:38:21 +00:00
Nick Lewycky
419c6f5ac8 New predicate simplifier!
Please do not enable, there is still some known miscompile problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 02:32:38 +00:00
Devang Patel
25919cb780 Add PassManagerType enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 01:10:25 +00:00
Reid Spencer
65de742b8a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33064 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:35:10 +00:00
Reid Spencer
5305478511 Implement better constant folding of unordered FCMP predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:25:45 +00:00
Devang Patel
97149737f2 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:19:00 +00:00
Reid Spencer
11f457aad3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 19:50:43 +00:00
Reid Spencer
162b02e327 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 09:18:16 +00:00
Chris Lattner
b2b442f06d Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 07:01:46 +00:00
Chris Lattner
55e73a5493 eliminate some iterator gymnastics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33052 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 06:43:26 +00:00
Reid Spencer
7679693fdf Change the file header name as this file was renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 04:17:32 +00:00
Reid Spencer
93a0962e08 Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33050 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 04:16:17 +00:00
Chris Lattner
39ff1e2afc Fix a bug in heap-sra that caused compilation failure of office-ispell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33043 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 23:29:37 +00:00
Reid Spencer
251f21492e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 17:09:09 +00:00
Chris Lattner
cf8790aaff Inline insertValue into CreateModuleSlot/CreateFunctionSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 08:04:59 +00:00
Chris Lattner
22990aae5c Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:58:11 +00:00
Chris Lattner
9446bbe7d4 Split CreateSlot into two versions, one for globals and one for function-local
values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:55:49 +00:00
Chris Lattner
3a4621c5f6 Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:46:21 +00:00
Reid Spencer
30f9e27f64 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 06:38:06 +00:00
Evan Cheng
c8edc64188 Naming consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:55:53 +00:00
Evan Cheng
c62d4bb695 Fix for PR1075: bottom-up register-reduction scheduling actually increases register pressure.
- Fixed bugs in sethi-ullman number computation and priority queue comparison
functions.
- Separate code that handles priority computation special cases from SU number computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:50:38 +00:00
Chris Lattner
ddae4bd683 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:04:05 +00:00
Jim Laskey
6488a078ba Need to handle static declarations properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 22:15:18 +00:00
Jeff Cohen
dfc12993b9 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 20:17:17 +00:00
Reid Spencer
877e7ce051 Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:41:01 +00:00
Devang Patel
09e6e4303f Add PMStack, a Pass Manager stack.
Eventually, Top level pass managers  will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33018 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:29:38 +00:00
Andrew Lenharth
43f344a266 And asm writing for packed struct initializers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 18:21:30 +00:00