Crash less. The i64 restriction in BinomialCoefficient caused some problems

with code that was expecting different bit widths for different values.

Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2008-06-13 04:38:55 +00:00
parent 52ed363fd3
commit 6f8abf929a
3 changed files with 78 additions and 24 deletions

View File

@@ -253,6 +253,11 @@ namespace llvm {
SCEVHandle getMinusSCEV(const SCEVHandle &LHS,
const SCEVHandle &RHS);
/// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion
/// of the input value to the specified type. If the type must be
/// extended, it is zero extended.
SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty);
/// getIntegerSCEV - Given an integer or FP type, create a constant for the
/// specified signed integer value and return a SCEV for the constant.
SCEVHandle getIntegerSCEV(int Val, const Type *Ty);