77 lines · plain
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,SLH2; RUN: sed -e 's/SLHATTR//' %s | llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,NOSLH3 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: W167; CHECK-NOT: warning: inline asm clobber list contains reserved registers: X168 9declare i64 @g(i64, i64) local_unnamed_addr10define i64 @f_using_reserved_reg_x16(i64 %a, i64 %b) local_unnamed_addr SLHATTR {11; CHECK-LABEL: f_using_reserved_reg_x1612; SLH: dsb sy13; SLH: isb14; NOSLH-NOT: dsb sy15; NOSLH-NOT: isb16entry:17 %cmp = icmp ugt i64 %a, %b18 br i1 %cmp, label %if.then, label %cleanup19 20; CHECK: b.ls21; SLH: dsb sy22; SLH: isb23; NOSLH-NOT: dsb sy24; NOSLH-NOT: isb25if.then:26 %0 = tail call i64 asm "hint #12", "={x17},{x16},0"(i64 %b, i64 %a)27; CHECK: bl g28; SLH: dsb sy29; SLH: isb30; NOSLH-NOT: dsb sy31; NOSLH-NOT: isb32; CHECK: ret33 %call = tail call i64 @g(i64 %a, i64 %b) #334 %add = add i64 %call, %035 br label %cleanup36 37cleanup:38; SLH: dsb sy39; SLH: isb40; NOSLH-NOT: dsb sy41; NOSLH-NOT: isb42; SLH: ret43 %retval.0 = phi i64 [ %add, %if.then ], [ %b, %entry ]44 ret i64 %retval.045}46 47define i32 @f_clobbered_reg_w16(i32 %a, i32 %b) local_unnamed_addr SLHATTR {48; CHECK-LABEL: f_clobbered_reg_w1649entry:50; SLH: dsb sy51; SLH: isb52; NOSLH-NOT: dsb sy53; NOSLH-NOT: isb54 %cmp = icmp sgt i32 %a, %b55 br i1 %cmp, label %if.then, label %if.end56; CHECK: b.le57 58if.then:59; SLH: dsb sy60; SLH: isb61; NOSLH-NOT: dsb sy62; NOSLH-NOT: isb63; CHECK: mov w16, w064 tail call void asm sideeffect "mov w16, ${0:w}", "r,~{w16}"(i32 %a)65 br label %if.end66; SLH: ret67 68if.end:69 %add = add nsw i32 %b, %a70 ret i32 %add71; SLH: dsb sy72; SLH: isb73; NOSLH-NOT: dsb sy74; NOSLH-NOT: isb75; SLH: ret76}77