1 ; RUN: sed -e 's/SLHATTR/speculative_load_hardening/' %s | llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,SLH
2 ; RUN: sed -e 's/SLHATTR//' %s | llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,NOSLH
4 ; As SLH is falling back to a technique that doesn't use X16, we shouldn't see any warnings about clobbers.
5 ; (this would come from f_clobbered_reg_w16, but warnings are first in the output)
6 ; CHECK-NOT: warning: inline asm clobber list contains reserved registers: W16
7 ; CHECK-NOT: warning: inline asm clobber list contains reserved registers: X16
9 declare i64 @g(i64, i64) local_unnamed_addr
10 define i64 @f_using_reserved_reg_x16(i64 %a, i64 %b) local_unnamed_addr SLHATTR {
11 ; CHECK-LABEL: f_using_reserved_reg_x16
17 %cmp = icmp ugt i64 %a, %b
18 br i1 %cmp, label %if.then, label %cleanup
26 %0 = tail call i64 asm "hint #12", "={x17},{x16},0"(i64 %b, i64 %a)
33 %call = tail call i64 @g(i64 %a, i64 %b) #3
34 %add = add i64 %call, %0
43 %retval.0 = phi i64 [ %add, %if.then ], [ %b, %entry ]
47 define i32 @f_clobbered_reg_w16(i32 %a, i32 %b) local_unnamed_addr SLHATTR {
48 ; CHECK-LABEL: f_clobbered_reg_w16
54 %cmp = icmp sgt i32 %a, %b
55 br i1 %cmp, label %if.then, label %if.end
64 tail call void asm sideeffect "mov w16, ${0:w}", "r,~{w16}"(i32 %a)
69 %add = add nsw i32 %b, %a