[llvm-dev] Inconsistency between datalayout description and implementation.

Eddy B. via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 13 12:18:21 PDT 2016


The LangRef states, for the alignments determined by datalayout:

> If no match is found, and the type sought is a vector type, then the largest vector type
> that is smaller than the sought vector type will be used as a fall back. This happens
> because <128 x double> can be implemented in terms of 64 <2 x double>, for example.

However, the implementation only uses vector alignments from
datalayout if they match exactly.
If no exact match is found, "natural alignment" is used (align =
next_power_of_2(size)).
A comment also states "This is consistent with what clang and llvm-gcc do".

Is the implementation correct, and if so, should the LangRef be updated?

Thanks,
- eddyb


More information about the llvm-dev mailing list