• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mcpu=skylake-avx512 -mtriple=x86_64-unknown-unknown | FileCheck %s
3
4@b = local_unnamed_addr global i32 0, align 4
5@c = local_unnamed_addr global i32 0, align 4
6@d = local_unnamed_addr global float 0.000000e+00, align 4
7
8define float @_Z3fn2v() {
9; CHECK-LABEL: _Z3fn2v:
10; CHECK:       # %bb.0: # %entry
11; CHECK-NEXT:    pushq %rax
12; CHECK-NEXT:    .cfi_def_cfa_offset 16
13; CHECK-NEXT:    callq _Z1av
14; CHECK-NEXT:    # kill: def $al killed $al def $eax
15; CHECK-NEXT:    kmovd %eax, %k1
16; CHECK-NEXT:    vmovss {{.*}}(%rip), %xmm0 {%k1} {z}
17; CHECK-NEXT:    cmpl $0, {{.*}}(%rip)
18; CHECK-NEXT:    je .LBB0_2
19; CHECK-NEXT:  # %bb.1: # %if.then
20; CHECK-NEXT:    vcvtsi2ssl {{.*}}(%rip), %xmm1, %xmm1
21; CHECK-NEXT:    kmovd %eax, %k1
22; CHECK-NEXT:    vxorps %xmm2, %xmm2, %xmm2
23; CHECK-NEXT:    vmovss %xmm2, %xmm1, %xmm1 {%k1}
24; CHECK-NEXT:    vmovss %xmm1, {{.*}}(%rip)
25; CHECK-NEXT:  .LBB0_2: # %if.end
26; CHECK-NEXT:    popq %rax
27; CHECK-NEXT:    .cfi_def_cfa_offset 8
28; CHECK-NEXT:    retq
29entry:
30  %call = tail call zeroext i1 @_Z1av()
31  %cond = select i1 %call, float 7.500000e-01, float 0.000000e+00
32  %0 = load i32, i32* @c, align 4
33  %tobool2 = icmp eq i32 %0, 0
34  br i1 %tobool2, label %if.end, label %if.then
35
36if.then:                                          ; preds = %entry
37  %1 = load i32, i32* @b, align 4
38  %2 = sitofp i32 %1 to float
39  %conv5 = select i1 %call, float 0.000000e+00, float %2
40  store float %conv5, float* @d, align 4
41  br label %if.end
42
43if.end:                                           ; preds = %entry, %if.then
44  ret float %cond
45}
46
47declare zeroext i1 @_Z1av()
48