clang not using prefered alignment for 'long long' or 'double'


I’m working on the XCore target where the target datalayout specifies i64:32:32 and f64:32:32.

The target also specifies:
LongLongAlign = 32;
SuitableAlign = 32;
DoubleAlign = LongDoubleAlign = 32;
(debug confirms that the access functions correctly returning 32)

However compiling:
void test(){ long long v=0; }
produces 64bit alignment:
define void @test() #0 {
%v = alloca i64, align 8
store i64 0, i64* %v, align 8
ret void

The following also fails:
// RUN: %clang_cc1 -triple xcore -verify %s
// expected-no-diagnostics
_Static_assert(sizeof(long long) == 8, “sizeof long long is wrong”);
_Static_assert(_Alignof(long long) == 4, “alignof long long is wrong”);
_Static_assert(sizeof(double) == 8, “sizeof double is wrong”);
_Static_assert(_Alignof(double) == 4, “alignof double is wrong”);

As the target is very memory sensitive ‘align 8’ is a wasteful, needless operation and as such is considered an error!

I have tried to trace where the decision to use an alignment of 8 is being made without success so far.
Help or comment most welcome.

found offending function.

/// getPreferredTypeAlign - Return the “preferred” alignment of the specified
/// type for the current target in bits. This can be different than the ABI
/// alignment in cases where it is beneficial for performance to overalign
/// a data type.