diff options
| author | Dan Gohman <gohman@apple.com> | 2009-04-03 20:11:30 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-04-03 20:11:30 +0000 |
| commit | 8bff8a1e876628b868c878493325005b0fa01fb2 (patch) | |
| tree | 937fb04c05d5af5322829426a964c727134f1367 /llvm/lib | |
| parent | 751e7e38332ea88017ee70ffe8c0f89c7fb98cb1 (diff) | |
| download | bcm5719-llvm-8bff8a1e876628b868c878493325005b0fa01fb2.tar.gz bcm5719-llvm-8bff8a1e876628b868c878493325005b0fa01fb2.zip | |
Fix a TargetLowering optimization so that it doesn't duplicate
loads when an input node has multiple uses.
llvm-svn: 68398
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 3f0bf5b1a9b..79a48a6fd9c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1464,6 +1464,7 @@ TargetLowering::SimplifySetCC(MVT VT, SDValue N0, SDValue N1, // in the same partial word, see if we can shorten the load. if (DCI.isBeforeLegalize() && N0.getOpcode() == ISD::AND && C1 == 0 && + N0.getNode()->hasOneUse() && isa<LoadSDNode>(N0.getOperand(0)) && N0.getOperand(0).getNode()->hasOneUse() && isa<ConstantSDNode>(N0.getOperand(1))) { |

