llvm-6502/lib/Transforms/Scalar
Chris Lattner c5eff4488b Symbolically evaluate constant expressions like &A[123] - &A[4].f.
This occurs in C++ code like:

#include <iostream>
#include <iterator>
int a[] = { 1, 2, 3, 4, 5 };
int main() {
  using namespace std;
  copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator<int>(cout, "\n"));
  return 0;
}

Before we would decide the loop trip count is:
sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4)

Now we decide it is "5".  Amazing.

This code will need to be refactored, but I'm doing that as a separate
commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 22:32:46 +00:00
..
ADCE.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
BasicBlockPlacement.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
CondPropagate.cpp eliminate redundant check 2007-01-12 18:35:11 +00:00
ConstantProp.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
CorrelatedExprs.cpp For PR1043: 2007-01-19 21:13:56 +00:00
DCE.cpp Inherit BasicBlockPass directly from Pass. 2007-01-25 23:23:25 +00:00
DeadStoreElimination.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
GCSE.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
IndVarSimplify.cpp rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger. 2007-01-15 02:27:26 +00:00
InstructionCombining.cpp Symbolically evaluate constant expressions like &A[123] - &A[4].f. 2007-01-30 22:32:46 +00:00
LICM.cpp For PR950: 2006-12-23 06:05:41 +00:00
LoopStrengthReduce.cpp rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger. 2007-01-15 02:27:26 +00:00
LoopUnroll.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
LoopUnswitch.cpp For PR1043: 2007-01-19 21:13:56 +00:00
LowerGC.cpp For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid 2007-01-30 20:08:39 +00:00
LowerPacked.cpp For PR950: 2006-12-31 05:48:39 +00:00
Makefile
PredicateSimplifier.cpp Simplify names of lattice values. SGTUNE becomes SGT, for example. 2007-01-29 02:56:54 +00:00
Reassociate.cpp For PR970: 2007-01-21 00:29:26 +00:00
Reg2Mem.cpp For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid 2007-01-30 20:08:39 +00:00
ScalarReplAggregates.cpp For PR970: 2007-01-21 00:29:26 +00:00
SCCP.cpp For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid 2007-01-30 20:08:39 +00:00
SimplifyCFG.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
TailDuplication.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00
TailRecursionElimination.cpp Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic 2006-12-19 21:40:18 +00:00