[llvm-dev] How to get CLang array alloca alignments to be smaller than 16 bytes?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sun May 5 13:01:55 PDT 2019

On Sun, 5 May 2019 at 19:41, Joan Lluch <joan.lluch at icloud.com> wrote:
> “LargeArrayMinWidth” is only on the following files:
> TargetInfo.cpp
> TargetInfo.h

OK, so I've downloaded the official Clang released source
(https://releases.llvm.org/7.0.0/cfe-7.0.0.src.tar.xz), and:

$ tar xvf Downloads/cfe-7.0.0.src.tar.xz
$ cd cfe-7.0.0.src/
$ grep -r LargeArrayMinWidth .
./include/clang/Basic/TargetInfo.h:  unsigned char LargeArrayMinWidth,
./include/clang/Basic/TargetInfo.h:  // getLargeArrayMinWidth/Align -
Return the minimum array size that is
./include/clang/Basic/TargetInfo.h:  unsigned getLargeArrayMinWidth()
const { return LargeArrayMinWidth; }
./lib/Basic/TargetInfo.cpp:  LargeArrayMinWidth = 0;
./lib/Basic/Targets/Hexagon.h:    LargeArrayMinWidth = 64;
./lib/Basic/Targets/NVPTX.cpp:  // - LargeArrayMinWidth,
LargeArrayAlign: Not visible across the
./lib/Basic/Targets/X86.h:    LargeArrayMinWidth = 128;
./lib/Basic/Targets/WebAssembly.h:    LargeArrayMinWidth = 128;
./lib/AST/ASTContext.cpp:        unsigned MinWidth =

I'm afraid I don't know what actually is happening here, but I think
the best explanation has to be that you're not actually looking at
Clang 7.0 source. That would definitely be my primary line of



More information about the llvm-dev mailing list