summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2011-05-11 14:40:50 +0000
committerNadav Rotem <nadav.rotem@intel.com>2011-05-11 14:40:50 +0000
commit42febc6e9963f82d5c56c3c7e6afe5e00769af41 (patch)
tree831ef5f6559c00be76e73b0b5554a74c4efb533d /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent104e99256d951674faadd865ed44ec698ede31ea (diff)
downloadllvm-42febc6e9963f82d5c56c3c7e6afe5e00769af41.tar.gz
llvm-42febc6e9963f82d5c56c3c7e6afe5e00769af41.tar.bz2
llvm-42febc6e9963f82d5c56c3c7e6afe5e00769af41.tar.xz
Fixes a bug in the DAGCombiner. LoadSDNodes have two values (data, chain).
If there is a store after the load node, then there is a chain, which means that there is another user. Thus, asking hasOneUser would fail. Instead we ask hasNUsesOfValue on the 'data' value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 9a0afa9eee..131e43cd1c 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6566,7 +6566,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
}
}
- if (!LN0 || !LN0->hasOneUse() || LN0->isVolatile())
+ if (!LN0 || !LN0->hasNUsesOfValue(1,0) || LN0->isVolatile())
return SDValue();
// If Idx was -1 above, Elt is going to be -1, so just return undef.