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
4 # Verify that when a function has the speculative_load_hardening attribute we
5 # never produce a CB(N)Z or TB(N)Z.
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 }
19 ; CHECK-LABEL: name: no_tbnz
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
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
43 ; CHECK-LABEL: name: no_cbz
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
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
69 ; CHECK-LABEL: name: fp
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
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