Skip to content

Commit 8395343

Browse files
authored
[X86] combineTruncate - trunc(srl(load(p),amt)) -> load(p+amt/8) - ensure we merge the full / truncated load chains (llvm#166160)
The full load might persist so ensure that the chains are merged into a token factor instead of just transferring the chain to the new load Noticed while trying to fix the regression reported from llvm#165540
1 parent 3d3fab1 commit 8395343

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54529,8 +54529,7 @@ static SDValue combineTruncate(SDNode *N, SelectionDAG &DAG,
5452954529
SDValue NewLoad =
5453054530
DAG.getLoad(VT, DL, Ld->getChain(), NewPtr, Ld->getPointerInfo(),
5453154531
Align(), Ld->getMemOperand()->getFlags());
54532-
DAG.ReplaceAllUsesOfValueWith(Src.getOperand(0).getValue(1),
54533-
NewLoad.getValue(1));
54532+
DAG.makeEquivalentMemoryOrdering(Ld, NewLoad);
5453454533
return NewLoad;
5453554534
}
5453654535
}

0 commit comments

Comments
 (0)