[PATCH] D11249: Fix PR#24142
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 09:31:06 PDT 2015
rnk added inline comments.
================
Comment at: test/CodeGen/ARM/align-sp-adjustment.ll:4
@@ +3,3 @@
+; CHECK: [sp, #2120]
+
+%struct.struct_2 = type { [172 x %struct.struct_1] }
----------------
Carrot wrote:
> This number is the sum of stack frame and the space of outward parameter(8). The stack frame is:
>
> push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
> .Ltmp0:
> .cfi_def_cfa_offset 36
> .Ltmp1:
> .cfi_offset lr, -4
> .Ltmp2:
> .cfi_offset r11, -8
> .Ltmp3:
> .cfi_offset r10, -12
> .Ltmp4:
> .cfi_offset r9, -16
> .Ltmp5:
> .cfi_offset r8, -20
> .Ltmp6:
> .cfi_offset r7, -24
> .Ltmp7:
> .cfi_offset r6, -28
> .Ltmp8:
> .cfi_offset r5, -32
> .Ltmp9:
> .cfi_offset r4, -36
> .pad #2064
> sub.w sp, sp, #2064
> .pad #12
> sub sp, #12
>
> 12 is padding, 2064 is the size of local variable, the rest are for callee saved registers. The only possible changing size is the space for callee saved registers, and the only possible optimization that can impact it is register allocation. There are several function call in the loop, most of the callee saved registers are used to keep variables cross function call, so this looks unlikely to change.
I think you can reduce this test case further to make it more robust and easier to understand.
The string parameters are probably not needed, and can be i32's or i8* null values to make it shorter.
The array can instead be a simple array of i32, like `%params = alloca i32, 516`, which gives an i32*, which requires less GEP manipulation.
================
Comment at: test/CodeGen/ARM/align-sp-adjustment.ll:14
@@ +13,3 @@
+declare i32* @_Z4bar3iiPKcS0_i(i32, i32, i8*, i8*, i32) #3
+declare void @_Z4bar1i8struct_2(i32, %struct.struct_2* byval align 4) #3
+declare i32 @_Z4bar2PiPKc(i32*, i8*) #3
----------------
I'm surprised this assembles, I don't see a definition of `#3` or any other attribute sets.
http://reviews.llvm.org/D11249
More information about the llvm-commits
mailing list