Fix PR9127 by reversing the operands even if they have more then one use.
[oota-llvm.git] / test / CodeGen / X86 / pr9127.ll
diff --git a/test/CodeGen/X86/pr9127.ll b/test/CodeGen/X86/pr9127.ll
new file mode 100644 (file)
index 0000000..af08490
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llc < %s | FileCheck %s
+
+define i8 @foobar(double %d, double* %x) {
+entry:
+  %tmp2 = load double* %x, align 8
+  %cmp = fcmp oeq double %tmp2, %d
+  %conv3 = zext i1 %cmp to i8
+  ret i8 %conv3
+}
+
+; test that the load is folded.
+; CHECK: ucomisd       (%rdi), %xmm0