[llvm-dev] Aligning Long Long Vairables

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 14 11:57:59 PST 2016


On 14 January 2016 at 11:01, Kumail Ahmed via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I'm trying to align long long variable on a 4 byte boundary. I tried
> to change to clang frontend as follow:
>
> LongLongAlign = 32 ; LongLongWidth = 64;

These mostly affect things like the preprocessor defines and
(possibly) applications of _Alignof.

> The asm output is still 8 bytes, when I declare a long long global array:

What's your target's DataLayout? You should be able to see it at the
top of any module you dump.

This is what I'd expect to affect how the backend deals with alignment
(including struct/array layout and variable definitions). There should
be an "-i64:N-" bit for your 64-bit type, and it sounds you want that
to read "-i64:32-". If there's no i64 entry, then the default is
(oddly) 32, so this isn't the issue.

Cheers.

Tim.


More information about the llvm-dev mailing list