Files
Reid Kleckner ff1d4d27d7 [X86] Fix Windows i1 zeroext conventions to use i8 instead of i32
Summary:
Re-lands r328386 and r328443, reverting r328482.

Incorporates fixes from @mstorsjo in D44876 (thanks!) so that small
parameters in i8 and i16 do not end up in the SysV register parameters
(EDI, ESI, etc).

I added tests for how we receive small parameters, since that is the
important part. It's always safe to store more bytes than will be read,
but the assumptions you make when loading them are what really matter.

I also tested this by self-hosting clang and it passed tests on win64.

Reviewers: mstorsjo, hans

Subscribers: hiraditya, mstorsjo, llvm-commits

Differential Revision: https://reviews.llvm.org/D44900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328570 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:49:48 +00:00

24 lines
522 B
LLVM

; RUN: llc < %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefix=CHECK
; RUN: llc < %s -mtriple=x86_64-windows-gnu | FileCheck %s --check-prefix=CHECK
define i32 @pass_bool(i1 zeroext %b) {
entry:
%cond = select i1 %b, i32 66, i32 0
ret i32 %cond
}
; CHECK-LABEL: pass_bool:
; CHECK-DAG: testb %cl, %cl
; CHECK-DAG: movl $66,
; CHECK: cmovel {{.*}}, %eax
; CHECK: retq
define zeroext i1 @ret_true() {
entry:
ret i1 true
}
; CHECK-LABEL: ret_true:
; CHECK: movb $1, %al
; CHECK: retq