Skip to content

Commit 756b2ce

Browse files
committed
fixup! remove helper
1 parent 28dd6d4 commit 756b2ce

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8593,7 +8593,7 @@ SDValue PPCTargetLowering::LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG,
85938593
// to insert our load, L, into the chain as a peer of O. To do this, we give L
85948594
// the same chain operand as O, we create a token factor from the chain results
85958595
// of O and L, and we replace all uses of O's chain result with that token
8596-
// factor (see spliceIntoChain below for this last part).
8596+
// factor (this last part is handled by makeEquivalentMemoryOrdering).
85978597
bool PPCTargetLowering::canReuseLoadAddress(SDValue Op, EVT MemVT,
85988598
ReuseLoadInfo &RLI,
85998599
SelectionDAG &DAG,
@@ -8648,18 +8648,6 @@ bool PPCTargetLowering::canReuseLoadAddress(SDValue Op, EVT MemVT,
86488648
return true;
86498649
}
86508650

8651-
// Given the head of the old chain, ResChain, insert a token factor containing
8652-
// it and NewResChain, and make users of ResChain now be users of that token
8653-
// factor.
8654-
void PPCTargetLowering::spliceIntoChain(SDValue ResChain,
8655-
SDValue NewResChain,
8656-
SelectionDAG &DAG) const {
8657-
if (!ResChain)
8658-
return;
8659-
8660-
DAG.makeEquivalentMemoryOrdering(ResChain, NewResChain);
8661-
}
8662-
86638651
/// Analyze profitability of direct move
86648652
/// prefer float load to int load plus direct move
86658653
/// when there is no integer use of int load
@@ -8921,7 +8909,8 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op,
89218909
if (canReuseLoadAddress(SINT, MVT::i64, RLI, DAG)) {
89228910
Bits = DAG.getLoad(MVT::f64, dl, RLI.Chain, RLI.Ptr, RLI.MPI,
89238911
RLI.Alignment, RLI.MMOFlags(), RLI.AAInfo, RLI.Ranges);
8924-
spliceIntoChain(RLI.ResChain, Bits.getValue(1), DAG);
8912+
if (RLI.ResChain)
8913+
DAG.makeEquivalentMemoryOrdering(RLI.ResChain, Bits.getValue(1));
89258914
} else if (Subtarget.hasLFIWAX() &&
89268915
canReuseLoadAddress(SINT, MVT::i32, RLI, DAG, ISD::SEXTLOAD)) {
89278916
MachineMemOperand *MMO =
@@ -8931,7 +8920,8 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op,
89318920
Bits = DAG.getMemIntrinsicNode(PPCISD::LFIWAX, dl,
89328921
DAG.getVTList(MVT::f64, MVT::Other),
89338922
Ops, MVT::i32, MMO);
8934-
spliceIntoChain(RLI.ResChain, Bits.getValue(1), DAG);
8923+
if (RLI.ResChain)
8924+
DAG.makeEquivalentMemoryOrdering(RLI.ResChain, Bits.getValue(1));
89358925
} else if (Subtarget.hasFPCVT() &&
89368926
canReuseLoadAddress(SINT, MVT::i32, RLI, DAG, ISD::ZEXTLOAD)) {
89378927
MachineMemOperand *MMO =
@@ -8941,7 +8931,8 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op,
89418931
Bits = DAG.getMemIntrinsicNode(PPCISD::LFIWZX, dl,
89428932
DAG.getVTList(MVT::f64, MVT::Other),
89438933
Ops, MVT::i32, MMO);
8944-
spliceIntoChain(RLI.ResChain, Bits.getValue(1), DAG);
8934+
if (RLI.ResChain)
8935+
DAG.makeEquivalentMemoryOrdering(RLI.ResChain, Bits.getValue(1));
89458936
} else if (((Subtarget.hasLFIWAX() &&
89468937
SINT.getOpcode() == ISD::SIGN_EXTEND) ||
89478938
(Subtarget.hasFPCVT() &&
@@ -9037,8 +9028,9 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op,
90379028
DAG.getVTList(MVT::f64, MVT::Other), Ops,
90389029
MVT::i32, MMO);
90399030
Chain = Ld.getValue(1);
9040-
if (ReusingLoad)
9041-
spliceIntoChain(RLI.ResChain, Ld.getValue(1), DAG);
9031+
if (ReusingLoad && RLI.ResChain) {
9032+
DAG.makeEquivalentMemoryOrdering(RLI.ResChain, Ld.getValue(1));
9033+
}
90429034
} else {
90439035
assert(Subtarget.isPPC64() &&
90449036
"i32->FP without LFIWAX supported only on PPC64");
@@ -11660,7 +11652,8 @@ SDValue PPCTargetLowering::LowerSCALAR_TO_VECTOR(SDValue Op,
1166011652
SDValue Bits = DAG.getMemIntrinsicNode(
1166111653
PPCISD::LD_SPLAT, dl, DAG.getVTList(MVT::v4i32, MVT::Other), Ops,
1166211654
MVT::i32, MMO);
11663-
spliceIntoChain(RLI.ResChain, Bits.getValue(1), DAG);
11655+
if (RLI.ResChain)
11656+
DAG.makeEquivalentMemoryOrdering(RLI.ResChain, Bits.getValue(1));
1166411657
return Bits.getValue(0);
1166511658
}
1166611659

llvm/lib/Target/PowerPC/PPCISelLowering.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,6 @@ namespace llvm {
12261226
bool canReuseLoadAddress(SDValue Op, EVT MemVT, ReuseLoadInfo &RLI,
12271227
SelectionDAG &DAG,
12281228
ISD::LoadExtType ET = ISD::NON_EXTLOAD) const;
1229-
void spliceIntoChain(SDValue ResChain, SDValue NewResChain,
1230-
SelectionDAG &DAG) const;
12311229

12321230
void LowerFP_TO_INTForReuse(SDValue Op, ReuseLoadInfo &RLI,
12331231
SelectionDAG &DAG, const SDLoc &dl) const;

0 commit comments

Comments
 (0)