From 86e10f92b55fc4ab68526ff6f3fa8db75fba4c40 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 6 Oct 2015 20:51:26 +0000 Subject: [PATCH] [ARM] Minor refactoring. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249464 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMISelLowering.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 4bdda40d9ae..a3af444ced9 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -9844,12 +9844,13 @@ static SDValue PerformVCVTCombine(SDNode *N, SelectionDAG &DAG, if (!Op.getValueType().isVector() || Op.getOpcode() != ISD::FMUL) return SDValue(); - uint64_t C; SDValue ConstVec = Op->getOperand(1); - bool isSigned = N->getOpcode() == ISD::FP_TO_SINT; + if (!isa(ConstVec)) + return SDValue(); - if (ConstVec.getOpcode() != ISD::BUILD_VECTOR || - !isConstVecPow2(ConstVec, isSigned, C)) + uint64_t C; + bool isSigned = N->getOpcode() == ISD::FP_TO_SINT; + if (!isConstVecPow2(ConstVec, isSigned, C)) return SDValue(); MVT FloatTy = Op.getSimpleValueType().getVectorElementType(); @@ -9899,12 +9900,13 @@ static SDValue PerformVDIVCombine(SDNode *N, SelectionDAG &DAG, (OpOpcode != ISD::SINT_TO_FP && OpOpcode != ISD::UINT_TO_FP)) return SDValue(); - uint64_t C; SDValue ConstVec = N->getOperand(1); - bool isSigned = OpOpcode == ISD::SINT_TO_FP; + if (!isa(ConstVec)) + return SDValue(); - if (ConstVec.getOpcode() != ISD::BUILD_VECTOR || - !isConstVecPow2(ConstVec, isSigned, C)) + uint64_t C; + bool isSigned = OpOpcode == ISD::SINT_TO_FP; + if (!isConstVecPow2(ConstVec, isSigned, C)) return SDValue(); MVT FloatTy = N->getSimpleValueType(0).getVectorElementType(); -- 2.34.1