Joan Lluch via llvm-dev
2019-May-05 18:41 UTC
[llvm-dev] How to get CLang array alloca alignments to be smaller than 16 bytes?
> Are you looking in Clang's source, and that from the same 7.0 version?Yes, I am, and it’s the same version (7.0.1). “LargeArrayMinWidth” is only on the following files: TargetInfo.cpp TargetInfo.h So I still think there’s something else that makes the difference on the x86 target. Anyway, I will now investigate other targets as my temporary frontend. It is right that other targets do not create such big alignments. Thanks for your help. John Tel: 620 28 45 13> On 5 May 2019, at 20:10, Tim Northover <t.p.northover at gmail.com> wrote: > > On Sun, 5 May 2019 at 18:26, Joan Lluch <joan.lluch at icloud.com> wrote: >> I appreciate your reply, but I can’t still find any relation with “LargeArrayMinWidth” and x86 target. > > Are you looking in Clang's source, and that from the same 7.0 version? > If not, you should be. It traces back to 2010; r105500 to be exact: > https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20100531/030985.html > > For a long while references were in a single file (Targets.cpp), but > they'd been split up into one file per target before 7.0 > (Targets/XYZ.cpp). > >> I think there should be something else that causes my issue. > > I think that's unlikely. > >> Are you sure there’s nothing else beyond LargeArrayMinWidth that causes this? > > No, but I am sure the LargeArray stuff exists and behaviour I see from > multiple targets matches what I'd expect from the values I see set in > the source. > > Cheers. > > Tim.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190505/0e721cd8/attachment.html>
Tim Northover via llvm-dev
2019-May-05 20:01 UTC
[llvm-dev] How to get CLang array alloca alignments to be smaller than 16 bytes?
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.hOK, 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, LargeArrayAlign; ./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 Target->getLargeArrayMinWidth(); 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 investigation. Cheers. Tim.
Joan Lluch via llvm-dev
2019-May-05 20:48 UTC
[llvm-dev] How to get CLang array alloca alignments to be smaller than 16 bytes?
Hi Tim I created an Xcode project with CMAKE, which should have the entire lot of files. Selecting the ‘install’ scheme Xcode compiles everything including all available targets for clang and llc, which then I can fully debug. So the Xcode project definitely has all the cpp files in it. However, I now have found that for some reason the .h files in the lib/Basic/Targets directory were not included as part of the Xcode project. This is kind of weird, as this is the only case that I found of .h files not being added to the project. I assume this is a bug on one of the cmake install files. The entire thing compiles anyway because the compiler finds the .h files as they are included in the .cpp source. I have been performing all searches in the convenience of the xCode environment, and since these particular files were missing from the project they didn’t appear in any searches. I suppose this can be reported as a bug of the Cmake configuration files for xCode. John> On 5 May 2019, at 22:01, Tim Northover <t.p.northover at gmail.com> wrote: > > 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, > LargeArrayAlign; > ./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 > Target->getLargeArrayMinWidth(); > > 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 > investigation. > > Cheers. > > Tim.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190505/9ed9fdc8/attachment.html>
Apparently Analagous Threads
- How to get CLang array alloca alignments to be smaller than 16 bytes?
- How to get CLang array alloca alignments to be smaller than 16 bytes?
- How to get CLang array alloca alignments to be smaller than 16 bytes?
- How to get CLang array alloca alignments to be smaller than 16 bytes?
- How to change CLang struct alignment behaviour?