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 | f50c7981ae9b81f1212d72a06d1c05e20d0559af (patch) | |
tree | 5ccb8a1549f1e7a872775012c3b4ee6bdd81fb0b /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 38f4dd7b5e333aee8f89cee85d1c79378fee0ffc (diff) |
Fix a TargetLowering optimization so that it doesn't duplicate
loads when an input node has multiple uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 3f0bf5b1a9..79a48a6fd9 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/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))) { |