diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-06 09:22:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-06 09:22:57 +0000 |
commit | aae317ac32c63a4cfea9925afa9cbd7a6cf1af77 (patch) | |
tree | 82e55eabd28683c213682765abf732dccd656e69 /lib/Target | |
parent | 5cbd37e5056f6a715333553e9d529e0ddddb3e78 (diff) | |
download | external_llvm-aae317ac32c63a4cfea9925afa9cbd7a6cf1af77.zip external_llvm-aae317ac32c63a4cfea9925afa9cbd7a6cf1af77.tar.gz external_llvm-aae317ac32c63a4cfea9925afa9cbd7a6cf1af77.tar.bz2 |
Fix a bug in x86's PreprocessForRMW logic that was exposed
by aggressive chain operand optimization. UpdateNodeOperands
does not modify the node in place if it would result in
a node identical to an existing node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index e1344da..7340d7f 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -342,9 +342,11 @@ static void MoveBelowTokenFactor(SelectionDAG *CurDAG, SDValue Load, Ops.push_back(Load.getOperand(0)); else Ops.push_back(TF.getOperand(i)); - CurDAG->UpdateNodeOperands(TF, &Ops[0], Ops.size()); - CurDAG->UpdateNodeOperands(Load, TF, Load.getOperand(1), Load.getOperand(2)); - CurDAG->UpdateNodeOperands(Store, Load.getValue(1), Store.getOperand(1), + SDValue NewTF = CurDAG->UpdateNodeOperands(TF, &Ops[0], Ops.size()); + SDValue NewLoad = CurDAG->UpdateNodeOperands(Load, NewTF, + Load.getOperand(1), + Load.getOperand(2)); + CurDAG->UpdateNodeOperands(Store, NewLoad.getValue(1), Store.getOperand(1), Store.getOperand(2), Store.getOperand(3)); } |