1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s 3# 4# Verify that when a function has the speculative_load_hardening attribute we 5# never produce a CB(N)Z or TB(N)Z. 6# 7 8--- | 9 define void @no_tbnz() speculative_load_hardening { ret void } 10 define void @no_cbz() speculative_load_hardening { ret void } 11 define void @fp() speculative_load_hardening { ret void } 12... 13 14--- 15name: no_tbnz 16legalized: true 17regBankSelected: true 18body: | 19 ; CHECK-LABEL: name: no_tbnz 20 ; CHECK: bb.0: 21 ; CHECK: successors: %bb.0(0x40000000), %bb.1(0x40000000) 22 ; CHECK: %reg:gpr32 = COPY $w0 23 ; CHECK: [[ANDSWri:%[0-9]+]]:gpr32 = ANDSWri %reg, 1, implicit-def $nzcv 24 ; CHECK: Bcc 0, %bb.1, implicit $nzcv 25 ; CHECK: B %bb.0 26 ; CHECK: bb.1: 27 ; CHECK: RET_ReallyLR 28 bb.0: 29 liveins: $w0 30 successors: %bb.0, %bb.1 31 %reg:gpr(s32) = COPY $w0 32 %cond:gpr(s1) = G_TRUNC %reg 33 G_BRCOND %cond(s1), %bb.1 34 G_BR %bb.0 35 bb.1: 36 RET_ReallyLR 37... 38--- 39name: no_cbz 40legalized: true 41regBankSelected: true 42body: | 43 ; CHECK-LABEL: name: no_cbz 44 ; CHECK: bb.0: 45 ; CHECK: successors: %bb.0(0x40000000), %bb.1(0x40000000) 46 ; CHECK: %reg:gpr32sp = COPY $w0 47 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri %reg, 0, 0, implicit-def $nzcv 48 ; CHECK: Bcc 0, %bb.1, implicit $nzcv 49 ; CHECK: B %bb.0 50 ; CHECK: bb.1: 51 ; CHECK: RET_ReallyLR 52 bb.0: 53 liveins: $w0 54 successors: %bb.0, %bb.1 55 %reg:gpr(s32) = COPY $w0 56 %zero:gpr(s32) = G_CONSTANT i32 0 57 %cmp:gpr(s32) = G_ICMP intpred(eq), %reg, %zero 58 %cond:gpr(s1) = G_TRUNC %cmp(s32) 59 G_BRCOND %cond(s1), %bb.1 60 G_BR %bb.0 61 bb.1: 62 RET_ReallyLR 63... 64--- 65name: fp 66legalized: true 67regBankSelected: true 68body: | 69 ; CHECK-LABEL: name: fp 70 ; CHECK: bb.0: 71 ; CHECK: successors: %bb.0(0x40000000), %bb.1(0x40000000) 72 ; CHECK: %reg0:fpr32 = COPY $s0 73 ; CHECK: %reg1:fpr32 = COPY $s1 74 ; CHECK: FCMPSrr %reg0, %reg1, implicit-def $nzcv 75 ; CHECK: Bcc 0, %bb.1, implicit $nzcv 76 ; CHECK: B %bb.0 77 ; CHECK: bb.1: 78 ; CHECK: RET_ReallyLR 79 bb.0: 80 liveins: $s0, $s1 81 successors: %bb.0, %bb.1 82 %reg0:fpr(s32) = COPY $s0 83 %reg1:fpr(s32) = COPY $s1 84 %cmp:gpr(s32) = G_FCMP floatpred(oeq), %reg0, %reg1 85 %cond:gpr(s1) = G_TRUNC %cmp(s32) 86 G_BRCOND %cond(s1), %bb.1 87 G_BR %bb.0 88 bb.1: 89 RET_ReallyLR 90