brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · cd0a77a Raw
43 lines · plain
1; FIXME: Add tests for global-isel/fast-isel.2 3; RUN: llc < %s -mtriple=arm64-windows | FileCheck %s4 5%class.C = type { [1 x i32] }6 7define dso_local void @"?bar"(ptr inreg noalias sret(%class.C) %agg.result) {8entry:9; CHECK-LABEL: bar10; CHECK: mov x19, x011; CHECK: bl "?foo"12; CHECK: mov x0, x1913 14  tail call void @"?foo"(ptr dereferenceable(4) %agg.result)15  ret void16}17 18declare dso_local void @"?foo"(ptr dereferenceable(4))19 20 21declare void @inreg_callee(ptr, ptr inreg sret(%class.C))22 23define void @inreg_caller_1(ptr %a, ptr inreg sret(%class.C) %b) {24; A different value is passed to the inreg parameter, so tail call is not possible.25; CHECK-LABEL: inreg_caller_126; CHECK: mov x19, x127; CHECK: bl inreg_callee28; CHECK: mov x0, x1929 30  tail call void @inreg_callee(ptr %b, ptr inreg sret(%class.C) %a)31  ret void32}33 34define void @inreg_caller_2(ptr %a, ptr inreg sret(%class.C) %b) {35; The inreg attribute and value line up between caller and callee, so it can36; be tail called.37; CHECK-LABEL: inreg_caller_238; CHECK: b inreg_callee39 40  tail call void @inreg_callee(ptr %a, ptr inreg sret(%class.C) %b)41  ret void42}43