@@ -33262,7 +33262,8 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33262
33262
SmallVectorImpl<SDValue>&Results,
33263
33263
SelectionDAG &DAG) const {
33264
33264
SDLoc dl(N);
33265
- switch (N->getOpcode()) {
33265
+ unsigned Opc = N->getOpcode();
33266
+ switch (Opc) {
33266
33267
default:
33267
33268
#ifndef NDEBUG
33268
33269
dbgs() << "ReplaceNodeResults: ";
@@ -33358,7 +33359,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33358
33359
EVT VT = N->getValueType(0);
33359
33360
assert(getTypeAction(*DAG.getContext(), VT) == TypeWidenVector &&
33360
33361
VT == MVT::v2i32 && "Unexpected VT!");
33361
- bool IsSigned = N->getOpcode() == ISD::SMULO;
33362
+ bool IsSigned = Opc == ISD::SMULO;
33362
33363
unsigned ExtOpc = IsSigned ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND;
33363
33364
SDValue Op0 = DAG.getNode(ExtOpc, dl, MVT::v2i64, N->getOperand(0));
33364
33365
SDValue Op1 = DAG.getNode(ExtOpc, dl, MVT::v2i64, N->getOperand(1));
@@ -33415,7 +33416,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33415
33416
Ops[0] = N->getOperand(1);
33416
33417
SDValue InVec1 = DAG.getNode(ISD::CONCAT_VECTORS, dl, InWideVT, Ops);
33417
33418
33418
- SDValue Res = DAG.getNode(N->getOpcode() , dl, WideVT, InVec0, InVec1);
33419
+ SDValue Res = DAG.getNode(Opc , dl, WideVT, InVec0, InVec1);
33419
33420
Results.push_back(Res);
33420
33421
return;
33421
33422
}
@@ -33453,7 +33454,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33453
33454
EVT ResVT = getTypeToTransformTo(*DAG.getContext(), VT);
33454
33455
SDValue N0 = DAG.getNode(ISD::CONCAT_VECTORS, dl, ResVT, Ops0);
33455
33456
SDValue N1 = DAG.getConstant(SplatVal, dl, ResVT);
33456
- SDValue Res = DAG.getNode(N->getOpcode() , dl, ResVT, N0, N1);
33457
+ SDValue Res = DAG.getNode(Opc , dl, ResVT, N0, N1);
33457
33458
Results.push_back(Res);
33458
33459
}
33459
33460
return;
@@ -33574,7 +33575,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33574
33575
(InVT == MVT::v4i16 || InVT == MVT::v4i8)){
33575
33576
assert(getTypeAction(*DAG.getContext(), InVT) == TypeWidenVector &&
33576
33577
"Unexpected type action!");
33577
- assert(N->getOpcode() == ISD::SIGN_EXTEND && "Unexpected opcode");
33578
+ assert(Opc == ISD::SIGN_EXTEND && "Unexpected opcode");
33578
33579
// Custom split this so we can extend i8/i16->i32 invec. This is better
33579
33580
// since sign_extend_inreg i8/i16->i64 requires an extend to i32 using
33580
33581
// sra. Then extending from i32 to i64 using pcmpgt. By custom splitting
@@ -33611,7 +33612,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33611
33612
33612
33613
// Promote the input to 128 bits. Type legalization will turn this into
33613
33614
// zext_inreg/sext_inreg.
33614
- In = DAG.getNode(N->getOpcode() , dl, InVT, In);
33615
+ In = DAG.getNode(Opc , dl, InVT, In);
33615
33616
}
33616
33617
33617
33618
// Perform custom splitting instead of the two stage extend we would get
@@ -33620,7 +33621,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33620
33621
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
33621
33622
assert(isTypeLegal(LoVT) && "Split VT not legal?");
33622
33623
33623
- SDValue Lo = getEXTEND_VECTOR_INREG(N->getOpcode() , dl, LoVT, In, DAG);
33624
+ SDValue Lo = getEXTEND_VECTOR_INREG(Opc , dl, LoVT, In, DAG);
33624
33625
33625
33626
// We need to shift the input over by half the number of elements.
33626
33627
unsigned NumElts = InVT.getVectorNumElements();
@@ -33630,7 +33631,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33630
33631
ShufMask[i] = i + HalfNumElts;
33631
33632
33632
33633
SDValue Hi = DAG.getVectorShuffle(InVT, dl, In, In, ShufMask);
33633
- Hi = getEXTEND_VECTOR_INREG(N->getOpcode() , dl, HiVT, Hi, DAG);
33634
+ Hi = getEXTEND_VECTOR_INREG(Opc , dl, HiVT, Hi, DAG);
33634
33635
33635
33636
SDValue Res = DAG.getNode(ISD::CONCAT_VECTORS, dl, VT, Lo, Hi);
33636
33637
Results.push_back(Res);
@@ -33642,8 +33643,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33642
33643
case ISD::FP_TO_UINT:
33643
33644
case ISD::STRICT_FP_TO_UINT: {
33644
33645
bool IsStrict = N->isStrictFPOpcode();
33645
- bool IsSigned = N->getOpcode() == ISD::FP_TO_SINT ||
33646
- N->getOpcode() == ISD::STRICT_FP_TO_SINT;
33646
+ bool IsSigned = Opc == ISD::FP_TO_SINT || Opc == ISD::STRICT_FP_TO_SINT;
33647
33647
EVT VT = N->getValueType(0);
33648
33648
SDValue Src = N->getOperand(IsStrict ? 1 : 0);
33649
33649
SDValue Chain = IsStrict ? N->getOperand(0) : SDValue();
@@ -33654,13 +33654,13 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33654
33654
EVT NVT = VT.isVector() ? VT.changeVectorElementType(MVT::f32) : MVT::f32;
33655
33655
if (IsStrict) {
33656
33656
Res =
33657
- DAG.getNode(N->getOpcode() , dl, {VT, MVT::Other},
33657
+ DAG.getNode(Opc , dl, {VT, MVT::Other},
33658
33658
{Chain, DAG.getNode(ISD::STRICT_FP_EXTEND, dl,
33659
33659
{NVT, MVT::Other}, {Chain, Src})});
33660
33660
Chain = Res.getValue(1);
33661
33661
} else {
33662
- Res = DAG.getNode(N->getOpcode(), dl, VT,
33663
- DAG.getNode(ISD::FP_EXTEND, dl, NVT, Src));
33662
+ Res =
33663
+ DAG.getNode(Opc, dl, VT, DAG.getNode(ISD::FP_EXTEND, dl, NVT, Src));
33664
33664
}
33665
33665
Results.push_back(Res);
33666
33666
if (IsStrict)
@@ -33683,13 +33683,12 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33683
33683
}
33684
33684
33685
33685
if (IsStrict) {
33686
- unsigned Opc =
33687
- IsSigned ? X86ISD::STRICT_CVTTP2SI : X86ISD::STRICT_CVTTP2UI;
33686
+ Opc = IsSigned ? X86ISD::STRICT_CVTTP2SI : X86ISD::STRICT_CVTTP2UI;
33688
33687
Res =
33689
33688
DAG.getNode(Opc, dl, {ResVT, MVT::Other}, {N->getOperand(0), Src});
33690
33689
Chain = Res.getValue(1);
33691
33690
} else {
33692
- unsigned Opc = IsSigned ? X86ISD::CVTTP2SI : X86ISD::CVTTP2UI;
33691
+ Opc = IsSigned ? X86ISD::CVTTP2SI : X86ISD::CVTTP2UI;
33693
33692
Res = DAG.getNode(Opc, dl, ResVT, Src);
33694
33693
}
33695
33694
@@ -33775,7 +33774,6 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33775
33774
return;
33776
33775
}
33777
33776
33778
- unsigned Opc;
33779
33777
if (IsStrict)
33780
33778
Opc = IsSigned ? X86ISD::STRICT_CVTTP2SI : X86ISD::STRICT_CVTTP2UI;
33781
33779
else
@@ -33814,7 +33812,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33814
33812
if (Src.getValueType() == MVT::v2f32 && IsStrict) {
33815
33813
Src = DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v4f32, Src,
33816
33814
DAG.getConstantFP(0.0, dl, MVT::v2f32));
33817
- SDValue Res = DAG.getNode(N->getOpcode() , dl, {MVT::v4i32, MVT::Other},
33815
+ SDValue Res = DAG.getNode(Opc , dl, {MVT::v4i32, MVT::Other},
33818
33816
{N->getOperand(0), Src});
33819
33817
Results.push_back(Res);
33820
33818
Results.push_back(Res.getValue(1));
@@ -33838,7 +33836,6 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33838
33836
std::max(NumElts, 128U / (unsigned)SrcVT.getSizeInBits());
33839
33837
MVT VecVT = MVT::getVectorVT(MVT::i64, NumElts);
33840
33838
MVT VecInVT = MVT::getVectorVT(SrcVT.getSimpleVT(), SrcElts);
33841
- unsigned Opc = N->getOpcode();
33842
33839
if (NumElts != SrcElts) {
33843
33840
if (IsStrict)
33844
33841
Opc = IsSigned ? X86ISD::STRICT_CVTTP2SI : X86ISD::STRICT_CVTTP2UI;
@@ -33892,8 +33889,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33892
33889
case ISD::UINT_TO_FP:
33893
33890
case ISD::STRICT_UINT_TO_FP: {
33894
33891
bool IsStrict = N->isStrictFPOpcode();
33895
- bool IsSigned = N->getOpcode() == ISD::SINT_TO_FP ||
33896
- N->getOpcode() == ISD::STRICT_SINT_TO_FP;
33892
+ bool IsSigned = Opc == ISD::SINT_TO_FP || Opc == ISD::STRICT_SINT_TO_FP;
33897
33893
EVT VT = N->getValueType(0);
33898
33894
SDValue Src = N->getOperand(IsStrict ? 1 : 0);
33899
33895
if (VT.getVectorElementType() == MVT::f16 && Subtarget.hasFP16() &&
@@ -33987,7 +33983,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
33987
33983
// FIXME: Should generic type legalizer do this?
33988
33984
Src = DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v4i32, Src,
33989
33985
DAG.getConstant(0, dl, MVT::v2i32));
33990
- SDValue Res = DAG.getNode(N->getOpcode() , dl, {MVT::v4f32, MVT::Other},
33986
+ SDValue Res = DAG.getNode(Opc , dl, {MVT::v4f32, MVT::Other},
33991
33987
{N->getOperand(0), Src});
33992
33988
Results.push_back(Res);
33993
33989
Results.push_back(Res.getValue(1));
0 commit comments