aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/dagcombine-select.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/dagcombine-select.ll')
-rw-r--r--test/CodeGen/X86/dagcombine-select.ll72
1 files changed, 38 insertions, 34 deletions
diff --git a/test/CodeGen/X86/dagcombine-select.ll b/test/CodeGen/X86/dagcombine-select.ll
index 2b05154676e6..1ef6cfdfd40a 100644
--- a/test/CodeGen/X86/dagcombine-select.ll
+++ b/test/CodeGen/X86/dagcombine-select.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-unknown-unknown -verify-machineinstrs < %s | FileCheck -enable-var-scope %s
-; RUN: llc -mtriple=x86_64-unknown-unknown -verify-machineinstrs -mattr=+bmi < %s | FileCheck -check-prefix=BMI -enable-var-scope %s
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,NOBMI -enable-var-scope
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -mattr=+bmi | FileCheck %s -check-prefixes=CHECK,BMI -enable-var-scope
define i32 @select_and1(i32 %x, i32 %y) {
; CHECK-LABEL: select_and1:
@@ -283,14 +283,14 @@ define double @frem_constant_sel_constants(i1 %cond) {
declare i64 @llvm.cttz.i64(i64, i1)
define i64 @cttz_64_eq_select(i64 %v) nounwind {
-; CHECK-LABEL: cttz_64_eq_select:
-; CHECK: # %bb.0:
-; CHECK-NEXT: bsfq %rdi, %rcx
-; CHECK-NEXT: movq $-1, %rax
-; CHECK-NEXT: cmovneq %rcx, %rax
-; CHECK-NEXT: addq $6, %rax
-; CHECK-NEXT: retq
-
+; NOBMI-LABEL: cttz_64_eq_select:
+; NOBMI: # %bb.0:
+; NOBMI-NEXT: bsfq %rdi, %rcx
+; NOBMI-NEXT: movq $-1, %rax
+; NOBMI-NEXT: cmovneq %rcx, %rax
+; NOBMI-NEXT: addq $6, %rax
+; NOBMI-NEXT: retq
+;
; BMI-LABEL: cttz_64_eq_select:
; BMI: # %bb.0:
; BMI-NEXT: tzcntq %rdi, %rcx
@@ -298,6 +298,7 @@ define i64 @cttz_64_eq_select(i64 %v) nounwind {
; BMI-NEXT: cmovaeq %rcx, %rax
; BMI-NEXT: addq $6, %rax
; BMI-NEXT: retq
+
%cnt = tail call i64 @llvm.cttz.i64(i64 %v, i1 true)
%tobool = icmp eq i64 %v, 0
%.op = add nuw nsw i64 %cnt, 6
@@ -306,14 +307,14 @@ define i64 @cttz_64_eq_select(i64 %v) nounwind {
}
define i64 @cttz_64_ne_select(i64 %v) nounwind {
-; CHECK-LABEL: cttz_64_ne_select:
-; CHECK: # %bb.0:
-; CHECK-NEXT: bsfq %rdi, %rcx
-; CHECK-NEXT: movq $-1, %rax
-; CHECK-NEXT: cmovneq %rcx, %rax
-; CHECK-NEXT: addq $6, %rax
-; CHECK-NEXT: retq
-
+; NOBMI-LABEL: cttz_64_ne_select:
+; NOBMI: # %bb.0:
+; NOBMI-NEXT: bsfq %rdi, %rcx
+; NOBMI-NEXT: movq $-1, %rax
+; NOBMI-NEXT: cmovneq %rcx, %rax
+; NOBMI-NEXT: addq $6, %rax
+; NOBMI-NEXT: retq
+;
; BMI-LABEL: cttz_64_ne_select:
; BMI: # %bb.0:
; BMI-NEXT: tzcntq %rdi, %rcx
@@ -321,6 +322,7 @@ define i64 @cttz_64_ne_select(i64 %v) nounwind {
; BMI-NEXT: cmovaeq %rcx, %rax
; BMI-NEXT: addq $6, %rax
; BMI-NEXT: retq
+
%cnt = tail call i64 @llvm.cttz.i64(i64 %v, i1 true)
%tobool = icmp ne i64 %v, 0
%.op = add nuw nsw i64 %cnt, 6
@@ -330,14 +332,14 @@ define i64 @cttz_64_ne_select(i64 %v) nounwind {
declare i32 @llvm.cttz.i32(i32, i1)
define i32 @cttz_32_eq_select(i32 %v) nounwind {
-; CHECK-LABEL: cttz_32_eq_select:
-; CHECK: # %bb.0:
-; CHECK-NEXT: bsfl %edi, %ecx
-; CHECK-NEXT: movl $-1, %eax
-; CHECK-NEXT: cmovnel %ecx, %eax
-; CHECK-NEXT: addl $6, %eax
-; CHECK-NEXT: retq
-
+; NOBMI-LABEL: cttz_32_eq_select:
+; NOBMI: # %bb.0:
+; NOBMI-NEXT: bsfl %edi, %ecx
+; NOBMI-NEXT: movl $-1, %eax
+; NOBMI-NEXT: cmovnel %ecx, %eax
+; NOBMI-NEXT: addl $6, %eax
+; NOBMI-NEXT: retq
+;
; BMI-LABEL: cttz_32_eq_select:
; BMI: # %bb.0:
; BMI-NEXT: tzcntl %edi, %ecx
@@ -345,6 +347,7 @@ define i32 @cttz_32_eq_select(i32 %v) nounwind {
; BMI-NEXT: cmovael %ecx, %eax
; BMI-NEXT: addl $6, %eax
; BMI-NEXT: retq
+
%cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)
%tobool = icmp eq i32 %v, 0
%.op = add nuw nsw i32 %cnt, 6
@@ -353,14 +356,14 @@ define i32 @cttz_32_eq_select(i32 %v) nounwind {
}
define i32 @cttz_32_ne_select(i32 %v) nounwind {
-; CHECK-LABEL: cttz_32_ne_select:
-; CHECK: # %bb.0:
-; CHECK-NEXT: bsfl %edi, %ecx
-; CHECK-NEXT: movl $-1, %eax
-; CHECK-NEXT: cmovnel %ecx, %eax
-; CHECK-NEXT: addl $6, %eax
-; CHECK-NEXT: retq
-
+; NOBMI-LABEL: cttz_32_ne_select:
+; NOBMI: # %bb.0:
+; NOBMI-NEXT: bsfl %edi, %ecx
+; NOBMI-NEXT: movl $-1, %eax
+; NOBMI-NEXT: cmovnel %ecx, %eax
+; NOBMI-NEXT: addl $6, %eax
+; NOBMI-NEXT: retq
+;
; BMI-LABEL: cttz_32_ne_select:
; BMI: # %bb.0:
; BMI-NEXT: tzcntl %edi, %ecx
@@ -368,6 +371,7 @@ define i32 @cttz_32_ne_select(i32 %v) nounwind {
; BMI-NEXT: cmovael %ecx, %eax
; BMI-NEXT: addl $6, %eax
; BMI-NEXT: retq
+
%cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)
%tobool = icmp ne i32 %v, 0
%.op = add nuw nsw i32 %cnt, 6