From bcb26d6880b246d29ec716e5cd6aabbb4703bfac Mon Sep 17 00:00:00 2001 From: Michael Kuperstein Date: Thu, 5 Mar 2015 08:38:57 +0000 Subject: [InstCombine] Fix an assertion when fmul has a ConstantExpr operand isNormalFp and isFiniteNonZeroFp should not assume vector operands can not be constant expressions. Patch by Pawel Jurek Differential Revision: http://reviews.llvm.org/D8053 llvm-svn: 231359 --- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index c48e3c9..40aa7c5 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp @@ -422,7 +422,7 @@ static bool isFiniteNonZeroFp(Constant *C) { if (C->getType()->isVectorTy()) { for (unsigned I = 0, E = C->getType()->getVectorNumElements(); I != E; ++I) { - ConstantFP *CFP = dyn_cast(C->getAggregateElement(I)); + ConstantFP *CFP = dyn_cast_or_null(C->getAggregateElement(I)); if (!CFP || !CFP->getValueAPF().isFiniteNonZero()) return false; } @@ -437,7 +437,7 @@ static bool isNormalFp(Constant *C) { if (C->getType()->isVectorTy()) { for (unsigned I = 0, E = C->getType()->getVectorNumElements(); I != E; ++I) { - ConstantFP *CFP = dyn_cast(C->getAggregateElement(I)); + ConstantFP *CFP = dyn_cast_or_null(C->getAggregateElement(I)); if (!CFP || !CFP->getValueAPF().isNormal()) return false; } -- cgit v1.1