1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64-unknown-unknown -run-pass=instruction-select -global-isel-abort=1 -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 1, %bb.1, implicit $nzcv
30 successors: %bb.0, %bb.1
31 %reg:gpr(s32) = COPY $w0
42 ; CHECK-LABEL: name: no_cbz
44 ; CHECK: successors: %bb.0(0x40000000), %bb.1(0x40000000)
45 ; CHECK: %reg:gpr32sp = COPY $w0
46 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri %reg, 0, 0, implicit-def $nzcv
47 ; CHECK: Bcc 0, %bb.1, implicit $nzcv
53 successors: %bb.0, %bb.1
54 %reg:gpr(s32) = COPY $w0
55 %zero:gpr(s32) = G_CONSTANT i32 0
56 %cmp:gpr(s32) = G_ICMP intpred(eq), %reg, %zero
67 ; CHECK-LABEL: name: fp
69 ; CHECK: successors: %bb.0(0x40000000), %bb.1(0x40000000)
70 ; CHECK: %reg0:fpr32 = COPY $s0
71 ; CHECK: %reg1:fpr32 = COPY $s1
72 ; CHECK: FCMPSrr %reg0, %reg1, implicit-def $nzcv
73 ; CHECK: Bcc 0, %bb.1, implicit $nzcv
79 successors: %bb.0, %bb.1
80 %reg0:fpr(s32) = COPY $s0
81 %reg1:fpr(s32) = COPY $s1
82 %cmp:gpr(s32) = G_FCMP floatpred(oeq), %reg0, %reg1