115 lines · plain
1# RUN: llc -mtriple=arm-none-eabi -run-pass=arm-cp-islands %s -o - | FileCheck %s2#3# This checks alignment of a block when a CPE is placed before/after a4# block (as e.g. opposed to splitting up a block), and also make sure5# we don't decrease alignment.6#7--- |8 ; ModuleID = '<stdin>'9 source_filename = "<stdin>"10 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"11 target triple = "arm-arm--eabi"12 13 declare i32 @llvm.arm.space(i32, i32) #014 15 define dso_local i32 @CP() #1 {16 entry:17 %res = alloca half, align 218 store half 0xH706B, ptr %res, align 219 %0 = load half, ptr %res, align 220 %tobool = fcmp une half %0, 0xH000021 br i1 %tobool, label %LA, label %END22 23 LA: ; preds = %entry24 %1 = call i32 @llvm.arm.space(i32 1000, i32 undef)25 br label %END26 27 END: ; preds = %LA, %entry28 %2 = call i32 @llvm.arm.space(i32 100, i32 undef)29 ret i32 4230 }31 32 ; Function Attrs: nounwind33 declare void @llvm.stackprotector(ptr, ptr) #234 35 attributes #0 = { nounwind "target-features"="+v8.2a,+fullfp16" }36 attributes #1 = { "target-features"="+v8.2a,+fullfp16" }37 attributes #2 = { nounwind }38 39...40---41name: CP42alignment: 443exposesReturnsTwice: false44legalized: false45regBankSelected: false46selected: false47tracksRegLiveness: true48registers:49liveins:50frameInfo:51 isFrameAddressTaken: false52 isReturnAddressTaken: false53 hasStackMap: false54 hasPatchPoint: false55 stackSize: 456 offsetAdjustment: 057 maxAlignment: 258 adjustsStack: false59 hasCalls: false60 stackProtector: ''61 maxCallFrameSize: 062 hasOpaqueSPAdjustment: false63 hasVAStart: false64 hasMustTailInVarArgFunc: false65 savePoint: []66 restorePoint: []67fixedStack:68stack:69 - { id: 0, name: res, type: default, offset: -2, size: 2, alignment: 2,70 stack-id: default, callee-saved-register: '', callee-saved-restored: true,71 local-offset: -2, debug-info-variable: '', debug-info-expression: '',72 debug-info-location: '' }73constants:74 - id: 075 value: half 0xH706B76 alignment: 277 isTargetSpecific: false78 79 80#CHECK: bb.{{.*}} (align 2):81#CHECK: successors:82#CHECK: CONSTPOOL_ENTRY 1, %const{{.*}}, 283#84# We don't want to decrease alignment if the block already has been85# aligned; this can e.g. be an existing CPE that has been carefully86# aligned. Here BB.1.LA has already an 8-byte alignment, and we are87# checking we don't set it to 4:88#89#CHECK: bb.{{.*}}.LA (align 8):90 91body: |92 bb.0.entry:93 successors: %bb.1(0x50000000), %bb.2(0x30000000)94 95 $sp = frame-setup SUBri $sp, 4, 14, $noreg, $noreg96 frame-setup CFI_INSTRUCTION def_cfa_offset 497 renamable $s0 = VLDRH %const.0, 0, 14, $noreg :: (load (s16) from constant-pool)98 VCMPZH renamable $s0, 14, $noreg, implicit-def $fpscr_nzcv, implicit $fpscr_rm99 VSTRH killed renamable $s0, $sp, 1, 14, $noreg :: (store (s16) into %ir.res)100 FMSTAT 14, $noreg, implicit-def $cpsr, implicit killed $fpscr_nzcv101 Bcc %bb.2, 0, killed $cpsr102 103 bb.1.LA (align 8):104 successors: %bb.2(0x80000000)105 106 dead renamable $r0 = SPACE 1000, undef renamable $r0107 108 bb.2.END:109 dead renamable $r0 = SPACE 100, undef renamable $r0110 $r0 = MOVi 42, 14, $noreg, $noreg111 $sp = ADDri $sp, 4, 14, $noreg, $noreg112 BX_RET 14, $noreg, implicit killed $r0113 114...115