1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=-bmi < %s | FileCheck %s --check-prefix=CHECK-NOBMI
3 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -mattr=+bmi < %s | FileCheck %s --check-prefix=CHECK-BMI
5 ; Optimize (x > -1) to (x >= 0) etc.
6 ; Optimize (cmp (add / sub), 0): eliminate the subs used to update flag
10 define i32 @t1(i64 %a) {
11 ; CHECK-NOBMI-LABEL: t1:
12 ; CHECK-NOBMI: # %bb.0:
13 ; CHECK-NOBMI-NEXT: xorl %eax, %eax
14 ; CHECK-NOBMI-NEXT: testq %rdi, %rdi
15 ; CHECK-NOBMI-NEXT: setns %al
16 ; CHECK-NOBMI-NEXT: retq
18 ; CHECK-BMI-LABEL: t1:
20 ; CHECK-BMI-NEXT: xorl %eax, %eax
21 ; CHECK-BMI-NEXT: testq %rdi, %rdi
22 ; CHECK-BMI-NEXT: setns %al
23 ; CHECK-BMI-NEXT: retq
24 %cmp = icmp sgt i64 %a, -1
25 %conv = zext i1 %cmp to i32