mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-19 17:33:29 +00:00
ebe8173941
rather than an int. Thankfully, this only causes LLVM to miss optimizations, not generate incorrect code. This just fixes the zext at the return. We still insert an i32 ZextAssert when reading a function's arguments, but it is followed by a truncate and another i8 ZextAssert so it is not optimized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127766 91177308-0d34-0410-b5e6-96231b3b80d8
36 lines
685 B
LLVM
36 lines
685 B
LLVM
; RUN: llc < %s -march=x86-64 | FileCheck %s
|
|
|
|
; CHECK: @bar1
|
|
; CHECK: movzbl
|
|
; CHECK: callq
|
|
define void @bar1(i1 zeroext %v1) nounwind ssp {
|
|
entry:
|
|
%conv = zext i1 %v1 to i32
|
|
%call = tail call i32 (...)* @foo1(i32 %conv) nounwind
|
|
ret void
|
|
}
|
|
|
|
; CHECK: @bar2
|
|
; CHECK-NOT: movzbl
|
|
; CHECK: callq
|
|
define void @bar2(i8 zeroext %v1) nounwind ssp {
|
|
entry:
|
|
%conv = zext i8 %v1 to i32
|
|
%call = tail call i32 (...)* @foo1(i32 %conv) nounwind
|
|
ret void
|
|
}
|
|
|
|
; CHECK: @bar3
|
|
; CHECK: callq
|
|
; CHECK-NOT: movzbl
|
|
; CHECK-NOT: and
|
|
; CHECK: ret
|
|
define zeroext i1 @bar3() nounwind ssp {
|
|
entry:
|
|
%call = call i1 @foo2() nounwind
|
|
ret i1 %call
|
|
}
|
|
|
|
declare i32 @foo1(...)
|
|
declare zeroext i1 @foo2()
|