Commit Graph

126 Commits

Author SHA1 Message Date
David Greene
b8f74793b9 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 15:46:09 +00:00
Devang Patel
b7211a2ce1 Use SmallVector instead of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 00:31:24 +00:00
Zhou Sheng
0d7d3656f3 Fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-27 09:50:26 +00:00
Dan Gohman
5cec4db6ae Rename ScalarEvolution::deleteInstructionFromRecords to
deleteValueFromRecords and loosen the types to all it to accept
Value* instead of just Instruction*, since this is what
ScalarEvolution uses internally anyway. This allows more flexibility
for future uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37657 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-19 14:28:31 +00:00
Dan Gohman
e19dd87598 Use SCEVConstant::get instead of SCEVUnknown::get to create an
integer constant SCEV.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 18:00:55 +00:00
Dan Gohman
d19534add9 Add a SCEV class and supporting code for sign-extend expressions.
This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-15 14:38:12 +00:00
Nick Lewycky
5adcefb04d Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-06 03:51:56 +00:00
Nick Lewycky
ecd94c804a Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 13:37:16 +00:00
Devang Patel
1997473cf7 Drop 'const'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 01:11:54 +00:00
Devang Patel
3e15bf33e0 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-02 21:39:20 +00:00
Devang Patel
794fd75c67 Do not use typeinfo to identify pass in pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-01 21:15:47 +00:00
Devang Patel
5ee9997906 Now IndVarSimplify is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35003 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 06:39:01 +00:00
Chris Lattner
9f3d738866 make better use of LCSSA information in RewriteLoopExitValues. Before, we
would scan the entire loop body, then scan all users of instructions in the
loop, looking for users outside the loop.  Now, since we know that the
loop is in LCSSA form, we know that any users outside the loop will be LCSSA
phi nodes.  Just scan them.

This speeds up indvars significantly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 03:43:23 +00:00
Chris Lattner
9caed5440d Implement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll
This makes -indvars require and use LCSSA, updating it as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34896 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 01:00:28 +00:00
Chris Lattner
c9838f25d5 Make RewriteLoopExitValues far less nested by using continue in the loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 22:48:48 +00:00
Reid Spencer
cae5754619 Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 00:28:52 +00:00
Chris Lattner
6934a04a8c Simplify code by using value::takename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 01:23:03 +00:00
Reid Spencer
9133fe2895 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 23:32:05 +00:00
Chris Lattner
fbbe92f5fd remove temporary vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 20:08:52 +00:00
Chris Lattner
55eb1c47de eliminate temporary vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33693 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:40:53 +00:00
Chris Lattner
42a7551725 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Chris Lattner
4d5f508318 Eliminate calls to isInteger, generalizing code and tightening checks as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 01:55:30 +00:00
Chris Lattner
ef60b2c4ed simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33150 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:51:20 +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
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
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
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
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
0e5f499638 Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer.  This also allows GCC to emit warnings
about unused statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32690 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 21:40:18 +00:00
Chris Lattner
ac0b6ae358 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 17:46:33 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Chris Lattner
9ba46c13bf Fix Transforms/IndVarsSimplify/2006-09-20-LFTR-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30555 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-21 05:12:20 +00:00
Chris Lattner
7f8897f22e eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:42:52 +00:00
Owen Anderson
eb70591492 Add an assertion to check that we're really preserving LCSSA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29886 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 22:12:36 +00:00
Owen Anderson
ac12322710 Reapply the indvars patch, since nothing blew up last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29874 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 17:41:25 +00:00
Owen Anderson
b397d81f03 Revert my previous patch. Since there are some major changes that went in today,
I'm going to wait to put this in HEAD until tomorrow, so as not to clutter the nightly
tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29868 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 03:45:57 +00:00
Owen Anderson
8a24749cb8 Specify that indvars actually preserve LCSSA. This has been done for a while, but I
forgot to put in the analysis usage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29867 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 03:32:13 +00:00
Reid Spencer
47a53ac726 Fix a grammaro in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29765 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 09:01:07 +00:00
Owen Anderson
c1be492f94 Hopefully the final attempt at making IndVars preserve LCSSA.
This should fix PR 831.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29141 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 18:49:15 +00:00
Chris Lattner
262041892d Revert this patch temporarily until PR831 is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29134 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-13 19:05:20 +00:00
Owen Anderson
bcfb913df0 IndVars now (correctly) preserves LCSSA form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 21:29:14 +00:00
Owen Anderson
4a8aadd1f5 Revert my indvars changes because they were breaking things. Unfortunately this
didn't start showing up until after the recent instcombine fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29102 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-11 07:25:33 +00:00
Owen Anderson
f9b238e93d De-pessimize the handling of LCSSA Phi nodes in IndVarSimplify. Hopefully this
will make Shootout-C/nestedloop faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28924 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-27 02:17:08 +00:00
Chris Lattner
eb83f4e6cd Fix IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll, a case where a
"LCSSA" phi node causes indvars to break dominance properties.  This fixes
causes indvars to avoid inserting aggressive code in this case, instead
indvars should be fixed to be more aggressive in the face of lcssa phi's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28850 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-17 01:02:31 +00:00
Chris Lattner
1730078d5f Fix a crash building 176.gcc due to my recent patch, which only fixed
half the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24414 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 18:30:47 +00:00
Chris Lattner
ceda605fd7 This was checking the wrong GEP expression. Fixing this fixes a gccas crash
compiling mysql reported by Ted Kremenek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24402 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 19:35:42 +00:00
Chris Lattner
cda9ca5a4f Allow indvar simplify to canonicalize ANY affine IV, not just affine IVs with
constant stride.  This implements Transforms/IndVarsSimplify/variable-stride-ivs.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22744 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-10 01:12:06 +00:00
Nate Begeman
36f891bdf6 Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 00:12:19 +00:00
Chris Lattner
4bd09d70cc Fix PR582. The rewriter can move casts around, which invalidated the
BB iterator.  This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22221 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 21:29:31 +00:00
Misha Brukman
fd93908ae8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 23:48:37 +00:00