Skip to content

Commit 6217f35

Browse files
authored
[NFC][AMDGPU] use DAG.UpdateNodeOperands update chain (#166396)
1 parent 8208591 commit 6217f35

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,12 +1129,9 @@ SDValue R600TargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const {
11291129
if ((AS == AMDGPUAS::PRIVATE_ADDRESS) && TruncatingStore) {
11301130
// Add an extra level of chain to isolate this vector
11311131
SDValue NewChain = DAG.getNode(AMDGPUISD::DUMMY_CHAIN, DL, MVT::Other, Chain);
1132-
// TODO: can the chain be replaced without creating a new store?
1133-
SDValue NewStore = DAG.getTruncStore(
1134-
NewChain, DL, Value, Ptr, StoreNode->getPointerInfo(), MemVT,
1135-
StoreNode->getAlign(), StoreNode->getMemOperand()->getFlags(),
1136-
StoreNode->getAAInfo());
1137-
StoreNode = cast<StoreSDNode>(NewStore);
1132+
SmallVector<SDValue, 4> NewOps(StoreNode->ops());
1133+
NewOps[0] = NewChain;
1134+
StoreNode = cast<StoreSDNode>(DAG.UpdateNodeOperands(StoreNode, NewOps));
11381135
}
11391136

11401137
return scalarizeVectorStore(StoreNode, DAG);

0 commit comments

Comments
 (0)