diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 2d73725291d11..f556647ae1f20 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -5527,7 +5527,7 @@ SDValue ARMTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const { ConstantSDNode *CFVal = dyn_cast(FalseVal); ConstantSDNode *CTVal = dyn_cast(TrueVal); ConstantSDNode *RHSC = dyn_cast(RHS); - if (Op.getValueType().isInteger()) { + if (LHS.getValueType() == MVT::i32 && RHS.getValueType() == MVT::i32) { // Check for sign pattern (SELECT_CC setgt, iN lhs, -1, 1, -1) and transform // into (OR (ASR lhs, N-1), 1), which requires less instructions for the // supported types.