diff options
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 1a9b9d7424a..7db409d39e2 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3844,7 +3844,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI, } else if (isa<Instruction>(NumElements) && cast<Instruction>(NumElements)->getOpcode() == Instruction::Mul){ BinaryOperator *BO = cast<BinaryOperator>(NumElements); - if (ConstantUInt *Scale = cast<ConstantUInt>(BO->getOperand(1))) { + if (ConstantUInt *Scale = dyn_cast<ConstantUInt>(BO->getOperand(1))) { // This value is scaled by 'Scale'. NumElements = BO->getOperand(0); ArraySizeScale = Scale->getValue(); |

