Displaying 1 result from an estimated 1 matches for "localbuff2".
Did you mean:
localbuff
2019 May 05
4
How to get CLang array alloca alignments to be smaller than 16 bytes?
I am working on a custom LLVM backend for a 16 bit architecture.
For my architecture, I need smaller array alignments for arrays created on the stack.
For example, consider the following code at the start of a C function:
char localBuff[20];
char localBuff2[6];
this gets converted by Clang into this:
%localBuff = alloca [20 x i8], align 16
%localBuff2 = alloca [6 x i8], align 1
Note that char arrays smaller than 16 bytes are specified to be aligned to 1 byte, but bigger ones are aligned to 16 bytes.
On the LLVM backend, this creates bigger tha...