summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/and-su.ll
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 /test/CodeGen/X86/and-su.ll
parent38f4dd7b5e333aee8f89cee85d1c79378fee0ffc (diff)
downloadllvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.tar.gz
llvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.tar.bz2
llvm-f50c7981ae9b81f1212d72a06d1c05e20d0559af.tar.xz
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 'test/CodeGen/X86/and-su.ll')
-rw-r--r--test/CodeGen/X86/and-su.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/X86/and-su.ll b/test/CodeGen/X86/and-su.ll
new file mode 100644
index 0000000000..bdc845448f
--- /dev/null
+++ b/test/CodeGen/X86/and-su.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep {(%} | count 1
+
+; Don't duplicate the load.
+
+define fastcc i32 @foo(i32* %p) nounwind {
+ %t0 = load i32* %p
+ %t2 = and i32 %t0, 10
+ %t3 = icmp ne i32 %t2, 0
+ br i1 %t3, label %bb63, label %bb76
+
+bb63:
+ ret i32 %t2
+
+bb76:
+ ret i32 0
+}