xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/arm64-patchpoint-scratch-regs.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=arm64-apple-darwin -enable-misched=0 -mcpu=cyclone < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Test that scratch registers are spilled around patchpoints
4*9880d681SAndroid Build Coastguard Worker; CHECK: InlineAsm End
5*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: mov x{{[0-9]+}}, x16
6*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: mov x{{[0-9]+}}, x17
7*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: Ltmp
8*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: nop
9*9880d681SAndroid Build Coastguard Workerdefine void @clobberScratch(i32* %p) {
10*9880d681SAndroid Build Coastguard Worker  %v = load i32, i32* %p
11*9880d681SAndroid Build Coastguard Worker  tail call void asm sideeffect "nop", "~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x18},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{x29},~{x30},~{x31}"() nounwind
12*9880d681SAndroid Build Coastguard Worker  tail call void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 5, i32 20, i8* null, i32 0, i32* %p, i32 %v)
13*9880d681SAndroid Build Coastguard Worker  store i32 %v, i32* %p
14*9880d681SAndroid Build Coastguard Worker  ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.experimental.patchpoint.void(i64, i32, i8*, i32, ...)
18*9880d681SAndroid Build Coastguard Worker
19