82 lines · plain
1# REQUIRES: asserts2# RUN: llc -mtriple=aarch64--linux-gnu -run-pass=branch-relaxation -debug-only=branch-relaxation %s -o /dev/null 2>&1 | FileCheck %s3# RUN: llc -mtriple=aarch64--linux-gnu -passes=branch-relaxation -debug-only=branch-relaxation %s -o /dev/null 2>&1 | FileCheck %s4 5# Ensure meta instructions (e.g. CFI_INSTRUCTION) don't contribute to the code6# size of a basic block.7 8# CHECK: Basic blocks before relaxation9# CHECK-NEXT: %bb.0 offset=00000000 size=0x1810# CHECK-NEXT: %bb.1 offset=00000018 size=0x411# CHECK-NEXT: %bb.2 offset=0000001c size=0xc12 13--- |14 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"15 target triple = "aarch64--linux-gnu"16 17 define i32 @test(ptr %a) #0 {18 entry:19 %call = tail call i32 @validate(ptr %a)20 %tobool = icmp eq i32 %call, 021 br i1 %tobool, label %return, label %if.then22 23 if.then: ; preds = %entry24 %0 = load i32, ptr %a, align 425 br label %return26 27 return: ; preds = %entry, %if.then28 %retval.0 = phi i32 [ %0, %if.then ], [ 0, %entry ]29 ret i32 %retval.030 }31 32 declare i32 @validate(ptr)33 34 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "frame-pointer"="all" }35 36...37---38name: test39alignment: 440tracksRegLiveness: true41liveins:42 - { reg: '$x0' }43frameInfo:44 stackSize: 3245 maxAlignment: 1646 adjustsStack: true47 hasCalls: true48 maxCallFrameSize: 049stack:50 - { id: 0, type: spill-slot, offset: -8, size: 8, alignment: 8, callee-saved-register: '$lr' }51 - { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 8, callee-saved-register: '$fp' }52 - { id: 2, type: spill-slot, offset: -32, size: 8, alignment: 16, callee-saved-register: '$x19' }53body: |54 bb.0.entry:55 successors: %bb.2(0x30000000), %bb.1(0x50000000)56 liveins: $x0, $x19, $lr57 58 early-clobber $sp = frame-setup STRXpre killed $x19, $sp, -32 :: (store (s64) into %stack.2)59 frame-setup STPXi $fp, killed $lr, $sp, 2 :: (store (s64) into %stack.1), (store (s64) into %stack.0)60 $fp = frame-setup ADDXri $sp, 16, 061 frame-setup CFI_INSTRUCTION def_cfa $w29, 1662 frame-setup CFI_INSTRUCTION offset $w30, -863 frame-setup CFI_INSTRUCTION offset $w29, -1664 frame-setup CFI_INSTRUCTION offset $w19, -3265 $x19 = ORRXrs $xzr, $x0, 066 BL @validate, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit-def $sp, implicit-def $w067 CBZW renamable $w0, %bb.268 69 bb.1.if.then:70 liveins: $x1971 72 renamable $w0 = LDRWui killed renamable $x19, 0 :: (load (s32) from %ir.a)73 74 bb.2.return:75 liveins: $w076 77 $fp, $lr = frame-destroy LDPXi $sp, 2 :: (load (s64) from %stack.1), (load (s64) from %stack.0)78 early-clobber $sp, $x19 = frame-destroy LDRXpost $sp, 32 :: (load (s64) from %stack.2)79 RET undef $lr, implicit killed $w080 81...82