Skip to content

Commit a0dde7b

Browse files
committed
[DAG] Remove (dead) legalization for atomic LoadSDNode and StoreSDNode
This should have been part of 943f3e5 which removed the never completed migration code which added these. I left them out because I thought there was more generic SDAG code to cleanup, but I'd forgotten that SystemZ relied on custom legalizing ATOMIC_LOAD to (atomic) LoadSDNode. As a result, we still need the various legality checks on combines and the common infrastructure to suport them.
1 parent 12e5148 commit a0dde7b

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,20 +3830,7 @@ void DAGTypeLegalizer::ExpandIntRes_XROUND_XRINT(SDNode *N, SDValue &Lo,
38303830

38313831
void DAGTypeLegalizer::ExpandIntRes_LOAD(LoadSDNode *N,
38323832
SDValue &Lo, SDValue &Hi) {
3833-
if (N->isAtomic()) {
3834-
// It's typical to have larger CAS than atomic load instructions.
3835-
SDLoc dl(N);
3836-
EVT VT = N->getMemoryVT();
3837-
SDVTList VTs = DAG.getVTList(VT, MVT::i1, MVT::Other);
3838-
SDValue Zero = DAG.getConstant(0, dl, VT);
3839-
SDValue Swap = DAG.getAtomicCmpSwap(
3840-
ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS, dl,
3841-
VT, VTs, N->getOperand(0),
3842-
N->getOperand(1), Zero, Zero, N->getMemOperand());
3843-
ReplaceValueWith(SDValue(N, 0), Swap.getValue(0));
3844-
ReplaceValueWith(SDValue(N, 1), Swap.getValue(2));
3845-
return;
3846-
}
3833+
assert(!N->isAtomic() && "Should have been a ATOMIC_LOAD?");
38473834

38483835
if (ISD::isNormalLoad(N)) {
38493836
ExpandRes_NormalLoad(N, Lo, Hi);
@@ -5398,16 +5385,8 @@ SDValue DAGTypeLegalizer::ExpandIntOp_XINT_TO_FP(SDNode *N) {
53985385
}
53995386

54005387
SDValue DAGTypeLegalizer::ExpandIntOp_STORE(StoreSDNode *N, unsigned OpNo) {
5401-
if (N->isAtomic()) {
5402-
// It's typical to have larger CAS than atomic store instructions.
5403-
SDLoc dl(N);
5404-
SDValue Swap = DAG.getAtomic(ISD::ATOMIC_SWAP, dl,
5405-
N->getMemoryVT(),
5406-
N->getOperand(0), N->getOperand(2),
5407-
N->getOperand(1),
5408-
N->getMemOperand());
5409-
return Swap.getValue(1);
5410-
}
5388+
assert(!N->isAtomic() && "Should have been a ATOMIC_STORE?");
5389+
54115390
if (ISD::isNormalStore(N))
54125391
return ExpandOp_NormalStore(N, OpNo);
54135392

0 commit comments

Comments
 (0)