2017-03-29 00:35:29 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-05-04 08:22:23 +08:00
|
|
|
; RUN: llc -o - -O0 < %s | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
define void @test1(i32 %x) #0 {
|
2016-07-06 22:15:43 +08:00
|
|
|
; CHECK-LABEL: test1:
|
|
|
|
; CHECK: # BB#0: # %entry
|
|
|
|
; CHECK-NEXT: pushq %rax
|
|
|
|
; CHECK-NEXT: testl %edi, %edi
|
|
|
|
; CHECK-NEXT: setne %al
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: # implicit-def: %EDI
|
2016-08-26 06:48:11 +08:00
|
|
|
; CHECK-NEXT: movb %al, %dil
|
|
|
|
; CHECK-NEXT: andl $1, %edi
|
2017-03-29 14:55:28 +08:00
|
|
|
; CHECK-NEXT: kmovd %edi, %k0
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: kmovd %k0, %edi
|
|
|
|
; CHECK-NEXT: movb %dil, %al
|
2016-07-06 22:15:43 +08:00
|
|
|
; CHECK-NEXT: andb $1, %al
|
|
|
|
; CHECK-NEXT: movzbl %al, %edi
|
|
|
|
; CHECK-NEXT: callq callee1
|
|
|
|
; CHECK-NEXT: popq %rax
|
|
|
|
; CHECK-NEXT: retq
|
2016-05-04 08:22:23 +08:00
|
|
|
entry:
|
|
|
|
%tobool = icmp ne i32 %x, 0
|
|
|
|
call void @callee1(i1 zeroext %tobool)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test2(i32 %x) #0 {
|
2016-07-06 22:15:43 +08:00
|
|
|
; CHECK-LABEL: test2:
|
|
|
|
; CHECK: # BB#0: # %entry
|
|
|
|
; CHECK-NEXT: pushq %rax
|
|
|
|
; CHECK-NEXT: testl %edi, %edi
|
|
|
|
; CHECK-NEXT: setne %al
|
2017-03-29 00:35:29 +08:00
|
|
|
; CHECK-NEXT: # implicit-def: %EDI
|
2016-08-26 06:48:11 +08:00
|
|
|
; CHECK-NEXT: movb %al, %dil
|
|
|
|
; CHECK-NEXT: andl $1, %edi
|
2017-03-29 14:55:28 +08:00
|
|
|
; CHECK-NEXT: kmovd %edi, %k0
|
|
|
|
; CHECK-NEXT: kmovd %k0, %edi
|
2016-08-26 06:48:11 +08:00
|
|
|
; CHECK-NEXT: andl $1, %edi
|
|
|
|
; CHECK-NEXT: movb %dil, %al
|
2016-07-06 22:15:43 +08:00
|
|
|
; CHECK-NEXT: xorl %edi, %edi
|
|
|
|
; CHECK-NEXT: testb %al, %al
|
2016-08-26 06:48:11 +08:00
|
|
|
; CHECK-NEXT: movl $-1, %ecx
|
|
|
|
; CHECK-NEXT: cmovnel %ecx, %edi
|
2016-07-06 22:15:43 +08:00
|
|
|
; CHECK-NEXT: callq callee2
|
|
|
|
; CHECK-NEXT: popq %rax
|
|
|
|
; CHECK-NEXT: retq
|
2016-05-04 08:22:23 +08:00
|
|
|
entry:
|
|
|
|
%tobool = icmp ne i32 %x, 0
|
|
|
|
call void @callee2(i1 signext %tobool)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @callee1(i1 zeroext)
|
|
|
|
declare void @callee2(i1 signext)
|
|
|
|
|
|
|
|
attributes #0 = { nounwind "target-cpu"="skylake-avx512" }
|