aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-03 20:11:30 +0000
committerDan Gohman <gohman@apple.com>2009-04-03 20:11:30 +0000
commitf50c7981ae9b81f1212d72a06d1c05e20d0559af (patch)
tree5ccb8a1549f1e7a872775012c3b4ee6bdd81fb0b /lib/CodeGen/SelectionDAG
parent38f4dd7b5e333aee8f89cee85d1c79378fee0ffc (diff)
downloadexternal_llvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.zip
external_llvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.tar.gz
external_llvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.tar.bz2
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')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 3f0bf5b..79a48a6 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))) {