summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-07-02 09:58:53 +0000
committerTim Northover <tnorthover@apple.com>2013-07-02 09:58:53 +0000
commit5bce67a95feb136389ca630cc5dd6a81e97ff1eb (patch)
tree1bfc49fd1475a3b8752ae9a9a2f5eca5c9f38bbe /test
parentb19dd2bcaf219a3b5f144815c40b3f1b11a3d35d (diff)
downloadllvm-5bce67a95feb136389ca630cc5dd6a81e97ff1eb.tar.gz
llvm-5bce67a95feb136389ca630cc5dd6a81e97ff1eb.tar.bz2
llvm-5bce67a95feb136389ca630cc5dd6a81e97ff1eb.tar.xz
DAGCombiner: fix use-counting issue when forming zextload
DAGCombiner was counting all uses of a load node when considering whether it's worth combining into a zextload. Really, it wants to ignore the chain and just count real uses. rdar://problem/13896307 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/simple-zext.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/X86/simple-zext.ll b/test/CodeGen/X86/simple-zext.ll
new file mode 100644
index 0000000000..ccd8292bcd
--- /dev/null
+++ b/test/CodeGen/X86/simple-zext.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple=x86_64-apple-darwin < %s| FileCheck %s
+
+; A bug in DAGCombiner prevented it forming a zextload in this simple case
+; because it counted both the chain user and the real user against the
+; profitability total.
+
+define void @load_zext(i32* nocapture %p){
+entry:
+ %0 = load i32* %p, align 4
+ %and = and i32 %0, 255
+ tail call void @use(i32 %and)
+ ret void
+; CHECK: movzbl ({{%r[a-z]+}}), {{%e[a-z]+}}
+}
+
+declare void @use(i32)