summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/2011-05-09-loaduse.ll
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 /test/CodeGen/X86/2011-05-09-loaduse.ll
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 'test/CodeGen/X86/2011-05-09-loaduse.ll')
-rw-r--r--test/CodeGen/X86/2011-05-09-loaduse.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2011-05-09-loaduse.ll b/test/CodeGen/X86/2011-05-09-loaduse.ll
new file mode 100644
index 0000000000..8673d7433f
--- /dev/null
+++ b/test/CodeGen/X86/2011-05-09-loaduse.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=x86 -mcpu=corei7 | FileCheck %s
+
+;CHECK: test
+;CHECK-not: pshufd
+;CHECK: ret
+define float @test(<4 x float>* %A) nounwind {
+entry:
+ %T = load <4 x float>* %A
+ %R = extractelement <4 x float> %T, i32 3
+ store <4 x float><float 0.0, float 0.0, float 0.0, float 0.0>, <4 x float>* %A
+ ret float %R
+}
+