1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv64 -stop-after=kcfi -verify-machineinstrs -o - %s | FileCheck %s
4 define void @f1(ptr noundef %x) !kcfi_type !1 {
5 ; CHECK-LABEL: name: f1
6 ; CHECK: bb.0 (%ir-block.0):
7 ; CHECK-NEXT: liveins: $x10, $x1
9 ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -16
10 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16
11 ; CHECK-NEXT: SD killed $x1, $x2, 8 :: (store (s64) into %stack.0)
12 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
13 ; CHECK-NEXT: BUNDLE implicit-def $x6, implicit-def $x6_w, implicit-def $x6_h, implicit-def $x7, implicit-def $x7_w, implicit-def $x7_h, implicit-def $x28, implicit-def $x28_w, implicit-def $x28_h, implicit-def $x29, implicit-def $x29_w, implicit-def $x29_h, implicit-def $x30, implicit-def $x30_w, implicit-def $x30_h, implicit-def $x31, implicit-def $x31_w, implicit-def $x31_h, implicit-def dead $x1, implicit-def $x2, implicit-def $x2_w, implicit-def $x2_h, implicit killed $x10 {
14 ; CHECK-NEXT: KCFI_CHECK $x10, 12345678, implicit-def $x6, implicit-def $x7, implicit-def $x28, implicit-def $x29, implicit-def $x30, implicit-def $x31
15 ; CHECK-NEXT: PseudoCALLIndirect killed $x10, csr_ilp32_lp64, implicit-def dead $x1, implicit-def $x2
17 ; CHECK-NEXT: $x1 = LD $x2, 8 :: (load (s64) from %stack.0)
18 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $x1
19 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 16
20 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
21 ; CHECK-NEXT: PseudoRET
22 call void %x() [ "kcfi"(i32 12345678) ]
26 define void @f2(ptr noundef %x) #0 {
27 ; CHECK-LABEL: name: f2
28 ; CHECK: bb.0 (%ir-block.0):
29 ; CHECK-NEXT: liveins: $x10
31 ; CHECK-NEXT: BUNDLE implicit-def $x6, implicit-def $x6_w, implicit-def $x6_h, implicit-def $x7, implicit-def $x7_w, implicit-def $x7_h, implicit-def $x28, implicit-def $x28_w, implicit-def $x28_h, implicit-def $x29, implicit-def $x29_w, implicit-def $x29_h, implicit-def $x30, implicit-def $x30_w, implicit-def $x30_h, implicit-def $x31, implicit-def $x31_w, implicit-def $x31_h, implicit killed $x10, implicit $x2 {
32 ; CHECK-NEXT: KCFI_CHECK $x10, 12345678, implicit-def $x6, implicit-def $x7, implicit-def $x28, implicit-def $x29, implicit-def $x30, implicit-def $x31
33 ; CHECK-NEXT: PseudoTAILIndirect killed $x10, implicit $x2
35 tail call void %x() [ "kcfi"(i32 12345678) ]
39 attributes #0 = { "patchable-function-entry"="2" }
41 !llvm.module.flags = !{!0}
43 !0 = !{i32 4, !"kcfi", i32 1}