Commit Graph

2736 Commits

Author SHA1 Message Date
Chris Lattner
97d1fad3d2 Branch conditions must be i1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:30:11 +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
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
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
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
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
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
abaa8ca433 Comparison of primitive type sizes should now be done in bits, not bytes.
This patch converts getPrimitiveSize to getPrimitiveSizeInBits where it is
appropriate to do so (comparison of integer primitive types).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 16:32:00 +00:00
Reid Spencer
ac8cdf79e7 For PR1097:
Enable complex addressing modes on 64-bit platforms involving two induction
variables by keeping a size and scale in 64-bits not 32.
Patch by Dan Gohman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33011 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 16:17:51 +00:00
Reid Spencer
3c628627ea Types should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33001 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 21:45:41 +00:00
Chris Lattner
ba8b327f67 this pass is unused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 18:12:43 +00:00
Chris Lattner
b76efb71d4 Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:12:01 +00:00
Chris Lattner
a121fddf3c prepare for adjustment to getOrInsertFunction method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 07:54:34 +00:00
Chris Lattner
febe5f1b3c relax some types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 07:22:20 +00:00
Chris Lattner
35057c2625 relax types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 06:59:47 +00:00
Chris Lattner
92141968cb relax some types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 06:58:05 +00:00
Chris Lattner
ee4f13a904 add -debug output for -indvars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32971 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 01:14:12 +00:00
Chris Lattner
46013f4044 Fix regressions in InstCombine/call-cast-target.ll and InstCombine/2003-11-13-ConstExprCastCall.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32959 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 19:53:32 +00:00
Reid Spencer
78d033e086 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 07:24:44 +00:00
Chris Lattner
80c6c3bbff this final call to canLosslesslyBitCastTo is dead, because ValueRequiresCast
is only called on integers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32949 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 02:11:56 +00:00
Chris Lattner
ec47992f5c simplify some more code now that there are not multiple different integer
types of the same size


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32948 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 02:09:32 +00:00
Chris Lattner
57d8637468 eliminate some uses of canLosslesslyBitCastTo, this actually makes the code stronger, by nuking
relational pointer comparisons with casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 01:45:59 +00:00
Chris Lattner
d5dc0fb011 no need to worry about int vs uint any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 01:37:35 +00:00
Chris Lattner
e4929dd0cc Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles with
undef operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32899 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 07:36:08 +00:00
Chris Lattner
4f0e33d145 fold things like a^b != c^a -> b != c. This implements InstCombine/xor.ll:test27
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 03:04:57 +00:00
Chris Lattner
e617c9ed5d Compile X + ~X to -1. This implements Instcombine/add.ll:test34
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 02:17:46 +00:00
Reid Spencer
8c5a53a603 Death to useless bitcast instructions!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 05:23:51 +00:00
Chris Lattner
7ce2f8b265 Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 02:12:40 +00:00
Jim Laskey
52ab904ee5 Vectors are not supported by ConstantInt::getAllOnesValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 00:11:03 +00:00
Reid Spencer
ee5d25e5cc Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32803 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 22:26:06 +00:00
Reid Spencer
c5b206b6be For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int   -> Int32
4. [U]Long  -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
   and other methods related to signedness. In a few places this warranted
   identifying the signedness information from other sources.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:48:39 +00:00
Reid Spencer
0f9d82c5c4 For PR1066:
Fix this by ensuring that a bitcast is inserted to do sign switching. This
is only temporarily needed as the merging of signed and unsigned is next
on the SignlessTypes plate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32757 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-24 00:40:59 +00:00
Reid Spencer
b3307b232a Shut up some compilers that can't accurately analyze variable usage
correctly and emit "may be used uninitialized" warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32756 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 19:17:57 +00:00
Reid Spencer
1b0d847874 For PR1065:
Don't allow CmpInst instances to be processed in FoldSelectOpOp because
you can't easily swap their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 18:58:04 +00:00
Reid Spencer
e4d87aa2de For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Chris Lattner
add2bd7f59 add a simple fast-path for dead allocas
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-22 23:14:42 +00:00
Reid Spencer
06e3f4ee7e Remove isSigned calls via foreknowledge of main's argument types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 07:49:49 +00:00
Reid Spencer
a2913eea9d Get rid of a useless if statement whose then and else blocks were identical.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 07:15:54 +00:00
Chris Lattner
3bad2533bb handle undef values much more carefully: generalize the resolveundefbranches
code to handle instructions as well, so that we properly fold things like
X & undef -> 0.
This fixes Transforms/SCCP/2006-12-19-UndefBug.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-20 06:21:33 +00:00
Chris Lattner
1c560adfd1 switch statistics over to not use static ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 23:16:47 +00:00
Chris Lattner
cbfdd1f840 eliminate static ctor from example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32696 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 22:24:09 +00:00
Chris Lattner
61bc8f8ca4 remove dead statistic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32695 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 22:23:21 +00:00
Chris Lattner
d216e8ba60 switch more statistics over to STATISTIC, eliminating static ctors. Also,
delete some dead ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 22:17:40 +00:00
Chris Lattner
86453c52ba Eliminate static ctors due to Statistic objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 22:09:18 +00:00