Commit Graph

2766 Commits

Author SHA1 Message Date
Reid Spencer 31a4ef4dc1 Cleanup checks in the load and store of casted pointer transforms. Two
changes: (1) don't special case for i1 any more, (2) use the new
TargetData::getTypeSizeInBits method to ensure source and dest are the
same bit width.

llvm-svn: 33427
2007-01-22 05:51:25 +00:00
Reid Spencer 2eadb5310d For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer 9a4bed06dd Revise the store V, (cast P) -> store (cast V) -> P transform.
We only want to do this if the src and destination types have the same
bit width. This patch uses TargetData::getTypeSizeInBits() instead of
making a special case for integer types and avoiding the transform if
they don't match.

llvm-svn: 33414
2007-01-20 23:35:48 +00:00
Chris Lattner 50ee0e40e5 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Owen Anderson dfd79ad319 Correct a comment.
llvm-svn: 33397
2007-01-20 10:07:23 +00:00
Reid Spencer e928a15c9e For this transform: store V, (cast P) -> store (cast V), P
don't allow the transform if V and the pointer's element type are different
width integer types.

llvm-svn: 33371
2007-01-19 21:20:31 +00:00
Reid Spencer a94d394ad2 For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Chris Lattner 120ab038eb Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombine
infinitely loops.

llvm-svn: 33343
2007-01-18 22:16:33 +00:00
Reid Spencer c050af9126 Clean up some code around the store V, (cast P) -> store (cast V), P
transform. Change some variable names so it is clear what is source and
what is dest of the cast. Also, add an assert to ensure that the integer
to integer case is asserting if the bitwidths are different. This prevents
illegal casts from being formed and catches bitwidth bugs sooner.

llvm-svn: 33337
2007-01-18 18:54:33 +00:00
Reid Spencer a8a1547370 For PR1094:
Adjust the use of SetVector for changes in SetVector's interface.
Patch by Gordon Henriksen.

llvm-svn: 33280
2007-01-17 02:23:37 +00:00
Chris Lattner 479a9fc492 Fix a regression in my isIntegral patch that broke 471.omnetpp. This is
because TargetData::getTypeSize() returns the same for i1 and i8.  This fix
is not right for the full generality of bitwise types, but it fixes the
regression.

llvm-svn: 33237
2007-01-15 17:55:20 +00:00
Nick Lewycky 6ce36cff3a Don't print address of ETNode. Print the DFSNumIn which uniquely identifies
the basic block and is stable across runs in gdb or valgrind.

Make Node::update handle edges which dominate and are tighter than
existing edges.

Replace makeEqual's "squeeze theorem" code. Fixes miscompilation.

Gate the calls to defToOps and opsToDef. Before this, we were getting IG
edges about values which weren't even defined in the dominated area. This
reduces the size of the IG by about half.

llvm-svn: 33236
2007-01-15 14:30:07 +00:00
Chris Lattner c8dcede292 Implement InstCombine/phi.ll:test7, deletion of trivial value loops for
induction variables.

llvm-svn: 33234
2007-01-15 07:30:06 +00:00
Chris Lattner 27df1db485 simplify some code now that types are signless
llvm-svn: 33232
2007-01-15 07:02:54 +00:00
Chris Lattner a4beeef76c delete stores to allocas with one use. This is a trivial form of DSE which
often kicks in for ?: expressions.

llvm-svn: 33231
2007-01-15 06:51:56 +00:00
Chris Lattner 03c4953cdd rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner 1942249c5b Eliminate calls to isInteger, generalizing code and tightening checks as needed.
llvm-svn: 33218
2007-01-15 01:55:30 +00:00
Chris Lattner f739d01059 Fix Analysis/Dominators/2006-10-02-BreakCritEdges.ll
llvm-svn: 33210
2007-01-15 00:15:09 +00:00
Chris Lattner 6ee923f3bb instcombine has always been miscompiling fcmp x, x, disregarding possible
NANs.  This fixes PR1111 and Transforms/InstCombine/2007-01-14-FcmpSelf.ll

llvm-svn: 33208
2007-01-14 19:42:17 +00:00
Chris Lattner 9818a6fd76 Fix PR1110 and Analysis/Dominators/2007-01-14-BreakCritEdges.ll by being
more careful about unreachable code when updating dominator info.

llvm-svn: 33204
2007-01-14 18:33:35 +00:00
Chris Lattner 387bf3f700 Fix Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll, which is part
of PR1107

llvm-svn: 33185
2007-01-13 23:11:38 +00:00
Reid Spencer 47bb5c996e Fix indentation to prior level for easier diffs.
llvm-svn: 33184
2007-01-13 05:10:53 +00:00
Nick Lewycky 4294446fcb "Default context" blocks can occur after a non-default one. This meant
that properties were being applied where they didn't belong. Fixes crash
in new MiBench testcase.

Also mark debugging code as such in #ifdef.

llvm-svn: 33177
2007-01-13 02:05:28 +00:00
Chris Lattner ff7434a526 Fix a minor bug handling constant exprs, introduced by a recent patch.
llvm-svn: 33175
2007-01-13 00:42:58 +00:00
Chris Lattner ca82a908e3 fix a bug in a recent patch
llvm-svn: 33164
2007-01-13 00:02:49 +00:00
Chris Lattner f5e5236b57 simplify some code
llvm-svn: 33150
2007-01-12 22:51:20 +00:00
Chris Lattner 3b6058c278 Remove over-general comparisons
llvm-svn: 33147
2007-01-12 22:49:11 +00:00
Chris Lattner e3721e3002 eliminate redundant check
llvm-svn: 33132
2007-01-12 18:35:11 +00:00
Chris Lattner 15649084e9 Branch conditions must be i1
llvm-svn: 33129
2007-01-12 18:30:11 +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
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
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
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 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
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
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
Jeff Cohen 223004cd12 Unbreak VC++ build.
llvm-svn: 33021
2007-01-08 20:17:17 +00:00
Reid Spencer 8f166b0ef3 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).

llvm-svn: 33012
2007-01-08 16:32:00 +00:00
Reid Spencer bf96e02a54 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.

llvm-svn: 33011
2007-01-08 16:17:51 +00:00
Reid Spencer 4f98e62831 Types should be const.
llvm-svn: 33001
2007-01-07 21:45:41 +00:00
Chris Lattner 950d0e9926 this pass is unused
llvm-svn: 32998
2007-01-07 18:12:43 +00:00
Chris Lattner 34acba48cc Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also

llvm-svn: 32989
2007-01-07 08:12:01 +00:00
Chris Lattner d97f1936bb prepare for adjustment to getOrInsertFunction method
llvm-svn: 32985
2007-01-07 07:54:34 +00:00
Chris Lattner cc4715e06e relax some types
llvm-svn: 32982
2007-01-07 07:22:20 +00:00
Chris Lattner 9641ab26ec relax types
llvm-svn: 32981
2007-01-07 06:59:47 +00:00
Chris Lattner fbc524fe87 relax some types
llvm-svn: 32980
2007-01-07 06:58:05 +00:00