@@ -1040,7 +1040,7 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
1040
1040
ISD::UINT_TO_FP});
1041
1041
1042
1042
setTargetDAGCombine({ISD::FP_TO_SINT, ISD::FP_TO_UINT, ISD::FP_TO_SINT_SAT,
1043
- ISD::FP_TO_UINT_SAT, ISD::FADD, ISD::FDIV });
1043
+ ISD::FP_TO_UINT_SAT, ISD::FADD});
1044
1044
1045
1045
// Try and combine setcc with csel
1046
1046
setTargetDAGCombine(ISD::SETCC);
@@ -17963,75 +17963,6 @@ static SDValue performFpToIntCombine(SDNode *N, SelectionDAG &DAG,
17963
17963
return FixConv;
17964
17964
}
17965
17965
17966
- /// Fold a floating-point divide by power of two into fixed-point to
17967
- /// floating-point conversion.
17968
- static SDValue performFDivCombine(SDNode *N, SelectionDAG &DAG,
17969
- TargetLowering::DAGCombinerInfo &DCI,
17970
- const AArch64Subtarget *Subtarget) {
17971
- if (!Subtarget->hasNEON())
17972
- return SDValue();
17973
-
17974
- SDValue Op = N->getOperand(0);
17975
- unsigned Opc = Op->getOpcode();
17976
- if (!Op.getValueType().isVector() || !Op.getValueType().isSimple() ||
17977
- !Op.getOperand(0).getValueType().isSimple() ||
17978
- (Opc != ISD::SINT_TO_FP && Opc != ISD::UINT_TO_FP))
17979
- return SDValue();
17980
-
17981
- SDValue ConstVec = N->getOperand(1);
17982
- if (!isa<BuildVectorSDNode>(ConstVec))
17983
- return SDValue();
17984
-
17985
- MVT IntTy = Op.getOperand(0).getSimpleValueType().getVectorElementType();
17986
- int32_t IntBits = IntTy.getSizeInBits();
17987
- if (IntBits != 16 && IntBits != 32 && IntBits != 64)
17988
- return SDValue();
17989
-
17990
- MVT FloatTy = N->getSimpleValueType(0).getVectorElementType();
17991
- int32_t FloatBits = FloatTy.getSizeInBits();
17992
- if (FloatBits != 32 && FloatBits != 64)
17993
- return SDValue();
17994
-
17995
- // Avoid conversions where iN is larger than the float (e.g., i64 -> float).
17996
- if (IntBits > FloatBits)
17997
- return SDValue();
17998
-
17999
- BitVector UndefElements;
18000
- BuildVectorSDNode *BV = cast<BuildVectorSDNode>(ConstVec);
18001
- int32_t C = BV->getConstantFPSplatPow2ToLog2Int(&UndefElements, FloatBits + 1);
18002
- if (C == -1 || C == 0 || C > FloatBits)
18003
- return SDValue();
18004
-
18005
- MVT ResTy;
18006
- unsigned NumLanes = Op.getValueType().getVectorNumElements();
18007
- switch (NumLanes) {
18008
- default:
18009
- return SDValue();
18010
- case 2:
18011
- ResTy = FloatBits == 32 ? MVT::v2i32 : MVT::v2i64;
18012
- break;
18013
- case 4:
18014
- ResTy = FloatBits == 32 ? MVT::v4i32 : MVT::v4i64;
18015
- break;
18016
- }
18017
-
18018
- if (ResTy == MVT::v4i64 && DCI.isBeforeLegalizeOps())
18019
- return SDValue();
18020
-
18021
- SDLoc DL(N);
18022
- SDValue ConvInput = Op.getOperand(0);
18023
- bool IsSigned = Opc == ISD::SINT_TO_FP;
18024
- if (IntBits < FloatBits)
18025
- ConvInput = DAG.getNode(IsSigned ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND, DL,
18026
- ResTy, ConvInput);
18027
-
18028
- unsigned IntrinsicOpcode = IsSigned ? Intrinsic::aarch64_neon_vcvtfxs2fp
18029
- : Intrinsic::aarch64_neon_vcvtfxu2fp;
18030
- return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, Op.getValueType(),
18031
- DAG.getConstant(IntrinsicOpcode, DL, MVT::i32), ConvInput,
18032
- DAG.getConstant(C, DL, MVT::i32));
18033
- }
18034
-
18035
17966
static SDValue tryCombineToBSL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
18036
17967
const AArch64TargetLowering &TLI) {
18037
17968
EVT VT = N->getValueType(0);
@@ -24720,8 +24651,6 @@ SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
24720
24651
case ISD::FP_TO_SINT_SAT:
24721
24652
case ISD::FP_TO_UINT_SAT:
24722
24653
return performFpToIntCombine(N, DAG, DCI, Subtarget);
24723
- case ISD::FDIV:
24724
- return performFDivCombine(N, DAG, DCI, Subtarget);
24725
24654
case ISD::OR:
24726
24655
return performORCombine(N, DCI, Subtarget, *this);
24727
24656
case ISD::AND:
0 commit comments