diff options
| author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-03-05 08:38:57 +0000 | 
|---|---|---|
| committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-03-05 08:38:57 +0000 | 
| commit | bcb26d6880b246d29ec716e5cd6aabbb4703bfac (patch) | |
| tree | ac35bcf94679bc0ad97767836fb6d0aea7a86ab8 /llvm/lib/Transforms/InstCombine | |
| parent | 35b3dbc4a3edd5e48c7913e11e4f9e3aa05b8e98 (diff) | |
| download | bcm5719-llvm-bcb26d6880b246d29ec716e5cd6aabbb4703bfac.tar.gz bcm5719-llvm-bcb26d6880b246d29ec716e5cd6aabbb4703bfac.zip | |
[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 <pawel.jurek@intel.com>
Differential Revision: http://reviews.llvm.org/D8053
llvm-svn: 231359
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp index c48e3c9f9ac..40aa7c5f454 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<ConstantFP>(C->getAggregateElement(I)); +      ConstantFP *CFP = dyn_cast_or_null<ConstantFP>(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<ConstantFP>(C->getAggregateElement(I)); +      ConstantFP *CFP = dyn_cast_or_null<ConstantFP>(C->getAggregateElement(I));        if (!CFP || !CFP->getValueAPF().isNormal())          return false;      } | 

