summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/cmov-into-branch.ll10
-rw-r--r--llvm/test/CodeGen/X86/select_meta.ll16
2 files changed, 21 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/cmov-into-branch.ll b/llvm/test/CodeGen/X86/cmov-into-branch.ll
index acb5a2bb51f..c0c6fc4ac22 100644
--- a/llvm/test/CodeGen/X86/cmov-into-branch.ll
+++ b/llvm/test/CodeGen/X86/cmov-into-branch.ll
@@ -103,11 +103,11 @@ define i32 @weighted_select3(i32 %a, i32 %b) {
; CHECK-LABEL: weighted_select3:
; CHECK: # BB#0:
; CHECK-NEXT: testl %edi, %edi
-; CHECK-NEXT: jne [[LABEL_BB6:.*]]
-; CHECK: movl %esi, %edi
-; CHECK-NEXT: [[LABEL_BB6]]
-; CHECK-NEXT: movl %edi, %eax
-; CHECK-NEXT: retq
+; CHECK-NEXT: je [[LABEL_BB6:.*]]
+; CHECK: movl %edi, %eax
+; CHECK: [[LABEL_BB6]]
+; CHECK-NEXT: movl %esi, %edi
+; CHECK-NEXT: jmp
;
%cmp = icmp ne i32 %a, 0
%sel = select i1 %cmp, i32 %a, i32 %b, !prof !2
diff --git a/llvm/test/CodeGen/X86/select_meta.ll b/llvm/test/CodeGen/X86/select_meta.ll
new file mode 100644
index 00000000000..0b2b344114d
--- /dev/null
+++ b/llvm/test/CodeGen/X86/select_meta.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple=x86_64-unknown-unknown -print-after-all < %s 2>&1 | FileCheck %s
+
+; Function Attrs: norecurse nounwind readnone uwtable
+define i32 @foo(i32, i32, i32) {
+ %4 = and i32 %0, 3
+ %5 = icmp eq i32 %4, 1
+ %6 = select i1 %5, i32 %1, i32 %2, !prof !1
+; CHECK: br {{.*}}label{{.*}}, label{{.*}}, !prof ![[WT:.*]]
+ ret i32 %6
+}
+
+!llvm.ident = !{!0}
+
+!0 = !{!"clang version 4.0.0 (trunk 279683)"}
+!1 = !{!"branch_weights", i32 1000, i32 1 }
+; CHECK ![[WT]] = !{!"branch_weights", i32 1000, i32 1 }
OpenPOWER on IntegriCloud