45 lines · plain
1# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s2 3# AArch64 Branch Target Enforcement treats the BR and BLR indirect branch4# instructions differently. The BLR instruction can only target a BTI C5# instruction, and the BR instruction can only target a BTI J instruction. We6# always start indirectly-called functions with BTI C, so the outliner must not7# transform a BLR instruction into a BR instruction.8 9# There is an exception to this: BR X16 and BR X17 can also target a BTI C10# instruction. We make of this for general tail-calls (tested elsewhere), but11# don't currently make use of this in the outliner.12 13# CHECK-NOT: OUTLINED_FUNCTION_14 15--- |16 @g = hidden local_unnamed_addr global i32 0, align 417 18 define hidden void @bar(ptr nocapture %f) "branch-target-enforcement" {19 entry:20 ret void21 }22 23 declare void @foo()24...25---26name: bar27tracksRegLiveness: true28body: |29 bb.0.entry:30 liveins: $x20, $x21, $lr, $x1931 32 HINT 3433 34 STRWui renamable $w21, renamable $x20, target-flags(aarch64-pageoff, aarch64-nc) @g :: (store (s32) into @g)35 BLR renamable $x19, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp36 37 STRWui renamable $w21, renamable $x20, target-flags(aarch64-pageoff, aarch64-nc) @g :: (store (s32) into @g)38 BLR renamable $x19, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp39 40 STRWui killed renamable $w21, killed renamable $x20, target-flags(aarch64-pageoff, aarch64-nc) @g :: (store (s32) into @g)41 BLR killed renamable $x19, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp42 43 TCRETURNdi @foo, 0, csr_aarch64_aapcs, implicit $sp44...45