1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
5 ; RUN: llc < %s -mtriple=x86_64-- -mattr=-sbb-dep-breaking | FileCheck %s --check-prefixes=ZERO
6 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+sbb-dep-breaking | FileCheck %s --check-prefixes=IDIOM
8 ; And check that CPUs have included the attribute as expected.
10 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefixes=ZERO
11 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=sandybridge | FileCheck %s --check-prefixes=ZERO
12 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=skylake | FileCheck %s --check-prefixes=ZERO
13 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=k8 | FileCheck %s --check-prefixes=IDIOM
14 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=btver1 | FileCheck %s --check-prefixes=IDIOM
15 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver2 | FileCheck %s --check-prefixes=IDIOM
16 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver3 | FileCheck %s --check-prefixes=IDIOM
18 define i32 @i32_select_0_or_neg1(i32 %x) {
19 ; ZERO-LABEL: i32_select_0_or_neg1:
21 ; ZERO-NEXT: xorl %eax, %eax
22 ; ZERO-NEXT: negl %edi
23 ; ZERO-NEXT: sbbl %eax, %eax
26 ; IDIOM-LABEL: i32_select_0_or_neg1:
28 ; IDIOM-NEXT: negl %edi
29 ; IDIOM-NEXT: sbbl %eax, %eax
31 %cmp = icmp ne i32 %x, 0
32 %sel = select i1 %cmp, i32 -1, i32 0