diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-07-24 16:53:14 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-07-24 16:53:14 +0000 |
commit | 3f01c7197f065d34c1d5e166e47193a6b39c5fbd (patch) | |
tree | 0ffb23deb3e5fdb278f1331c10a009cd40934129 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 5e1dd02c90995f4ce3ec183b9c62a423a1534530 (diff) | |
download | llvm-3f01c7197f065d34c1d5e166e47193a6b39c5fbd.zip llvm-3f01c7197f065d34c1d5e166e47193a6b39c5fbd.tar.gz llvm-3f01c7197f065d34c1d5e166e47193a6b39c5fbd.tar.bz2 |
[SelectionDAG] makeEquivalentMemoryOrdering - early out for equal chains (PR42727)
If we are already using the same chain for the old/new memory ops then just return.
Fixes PR42727 which had getLoad() reusing an existing node.
llvm-svn: 366922
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5852e69..ee9d13c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -8619,7 +8619,7 @@ SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad, // TokenFactor. SDValue OldChain = SDValue(OldLoad, 1); SDValue NewChain = SDValue(NewMemOp.getNode(), 1); - if (!OldLoad->hasAnyUseOfValue(1)) + if (OldChain == NewChain || !OldLoad->hasAnyUseOfValue(1)) return NewChain; SDValue TokenFactor = |