diff options
| author | Dan Gohman <gohman@apple.com> | 2010-06-24 16:45:11 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-06-24 16:45:11 +0000 |
| commit | c04092473cb40912a2af728b7ecf3ed293d50a75 (patch) | |
| tree | 077e75d146902e9a6d2df64df078dcd48b9ae2b3 | |
| parent | 31aced3e1744e5568e02e1a6f6d440386d84728b (diff) | |
| download | external_llvm-c04092473cb40912a2af728b7ecf3ed293d50a75.zip external_llvm-c04092473cb40912a2af728b7ecf3ed293d50a75.tar.gz external_llvm-c04092473cb40912a2af728b7ecf3ed293d50a75.tar.bz2 | |
Fix copy+pasto issues in isMulSExtable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106759 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index e8da89a..9982f1d 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -392,12 +392,13 @@ static bool isAddSExtable(const SCEVAddExpr *A, ScalarEvolution &SE) { return isa<SCEVAddExpr>(SE.getSignExtendExpr(A, WideTy)); } -/// isMulSExtable - Return true if the given add can be sign-extended +/// isMulSExtable - Return true if the given mul can be sign-extended /// without changing its value. -static bool isMulSExtable(const SCEVMulExpr *A, ScalarEvolution &SE) { +static bool isMulSExtable(const SCEVMulExpr *M, ScalarEvolution &SE) { const Type *WideTy = - IntegerType::get(SE.getContext(), SE.getTypeSizeInBits(A->getType()) + 1); - return isa<SCEVMulExpr>(SE.getSignExtendExpr(A, WideTy)); + IntegerType::get(SE.getContext(), + SE.getTypeSizeInBits(M->getType()) * M->getNumOperands()); + return isa<SCEVMulExpr>(SE.getSignExtendExpr(M, WideTy)); } /// getExactSDiv - Return an expression for LHS /s RHS, if it can be determined |
