summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-14 22:21:40 +0000
committerChris Lattner <sabre@nondot.org>2002-02-14 22:21:40 +0000
commit4ed4caf44a438382b1b7c44e3dc97a8a32e6764c (patch)
treebfd62b9a33ff94adb5777b5aa972aae2b90a3698 /llvm/lib/Transforms
parent18786d45b2f794b0953e24031736d7073caa2f3c (diff)
downloadbcm5719-llvm-4ed4caf44a438382b1b7c44e3dc97a8a32e6764c.tar.gz
bcm5719-llvm-4ed4caf44a438382b1b7c44e3dc97a8a32e6764c.zip
Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll
llvm-svn: 1767
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/ExprTypeConvert.cpp3
-rw-r--r--llvm/lib/Transforms/TransformInternals.cpp1
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp
index 5975a21ff3d..d716bca76de 100644
--- a/llvm/lib/Transforms/ExprTypeConvert.cpp
+++ b/llvm/lib/Transforms/ExprTypeConvert.cpp
@@ -307,8 +307,7 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
//
std::vector<Value*> Indices;
const Type *ElTy = ConvertableToGEP(PTy, I->getOperand(1), Indices);
- if (ElTy) {
- assert(ElTy == PVTy && "Internal error, setup wrong!");
+ if (ElTy == PVTy) {
if (!ExpressionConvertableToType(I->getOperand(0),
PointerType::get(ElTy), CTMap))
return false; // Can't continue, ExConToTy might have polluted set!
diff --git a/llvm/lib/Transforms/TransformInternals.cpp b/llvm/lib/Transforms/TransformInternals.cpp
index 6b42d0c7667..f773a1c473e 100644
--- a/llvm/lib/Transforms/TransformInternals.cpp
+++ b/llvm/lib/Transforms/TransformInternals.cpp
@@ -155,6 +155,7 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
int Val = getConstantValue(Expr.Scale);
if (Val < 0) return false; // Don't mess with negative scales
Scale = (unsigned)Val;
+ if (Scale == 1) Scale = 0; // No interesting scale if *1
}
// Loop over the Scale and Offset values, filling in the Indices vector for
OpenPOWER on IntegriCloud