Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
authorDan Gohman <gohman@apple.com>
Thu, 28 Jan 2010 02:15:55 +0000 (02:15 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 28 Jan 2010 02:15:55 +0000 (02:15 +0000)
commit0f5efe56258f8cd6ceff4d7955a5d80144cd9cb0
treeffc0c95b7ce6941d5729ffcf2b0a1fa3702a2a76
parentedfe776ac29d9fd48ae8967f6742400aad65e39c
Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.

Also add code for pattern-matching these expressions, for clients that
want to recognize them.

Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94737 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
include/llvm/Analysis/ScalarEvolutionExpressions.h
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionExpander.cpp
lib/VMCore/ConstantFold.cpp
lib/VMCore/Constants.cpp