Displaying 20 results from an estimated 2000 matches similar to: "How to change CLang struct alignment behaviour?"
2019 May 03
2
LLVM Virtual registers after RA pass?
I need to use ‘createVirtualRegister’ for a specific case in my ‘eliminateFrameIndex’ function implementation.
However, whenever that code is executed, I get the assertion "MachineCopyPropagation should be run after register allocation!” at a later stage.
I have seen that at least a couple of backend implementations (including ARM Thumb) create virtual registers in ‘eliminatedFrameIndex’.
2019 May 13
2
How to change CLang struct alignment behaviour?
Hi Tim,
Thanks for your reply. That’s what I was afraid of. I will try on the cfe-list as you suggest though.
The reason I want structs to be aligned/padded to 2 bytes is because my architecture only has 16 bit operations. I can read (sign and zero extended) and write (truncated) 8 bit data from/to memory, but all intermediate operations in registers are performed in 16 bit registers. This
2019 May 13
3
How to change CLang struct alignment behaviour?
I had already adjusted MaxStoresPerMemcpy to my preferred value, and this works great but for the cases where load/stores are used on non-size aligned structs the odd behaviour still happens. For my 3-char, 3-byte struct test, the memcpy replacement appears to consist on a single byte load and store of the last char (this is correct), followed by a 16 bit move of the first two chars, this is also
2019 May 14
2
How to change CLang struct alignment behaviour?
Hi John,
On Tue, 14 May 2019 at 17:51, Joan Lluch <joan.lluch at icloud.com> wrote:
> This problem is also shared by the MSP430 target, and it’s very easy to reproduce by just compiling the code that I posted before.
That's some good detective work; it definitely explains what you're
seeing. Since MSP430 is affected it would probably be pretty easy to
upstream an alignment-aware
2019 May 13
3
How to change CLang struct alignment behaviour?
Hi Joan,
On Mon, 13 May 2019 at 18:01, Joan Lluch <joan.lluch at icloud.com> wrote:
> After looking at it a bit further, I think this is a Clang thing. Clang issues “align 2” if the struct has at least one int (2 bytes), but also if the entire struct size is multiple of 2. For example a struct with 4 char members. In these cases the LLVM backend correctly creates word sized load/stores
2019 May 05
2
How to get CLang array alloca alignments to be smaller than 16 bytes?
To be honest, I don’t either know what really happens under the hood when CMake creates the xCode project for CLang+LLVM. But there’s something really explicit going on there, because the project as it’s shown in xCode does not have the same file grouping structure than the actual physical folders. Not only the project file grouping doesn't match the physical folder locations, but the group
2019 May 05
4
How to get CLang array alloca alignments to be smaller than 16 bytes?
I am working on a custom LLVM backend for a 16 bit architecture.
For my architecture, I need smaller array alignments for arrays created on the stack.
For example, consider the following code at the start of a C function:
char localBuff[20];
char localBuff2[6];
this gets converted by Clang into this:
%localBuff = alloca [20 x i8], align 16
%localBuff2 = alloca [6 x i8], align 1
Note
2019 Nov 04
2
Debugging clang with debugger breakpoints ?
Sorry Zach, my apologies.
I understood now what you mean. I tried and it works!.
But now I found that LLVM_DEBUG statements and other output to the console doesn’t show. How do I get that back?.
Thanks
John
> On 4 Nov 2019, at 22:26, Zachary Turner <zturner at roblox.com> wrote:
>
> You hit Reply on my email but then addressed David. So I want to make sure you saw my
2019 Jun 30
3
Tablegen ridiculously slow when compiling for Debug
Hi Praveen,
Thanks for the tip, but Xcode seems to spend all the time running tablegen "custom shell scripts", one by one at a time, not linking. Linking is actually very fast, possibly less than a second. The “scripts” that take longer are “AArch64CommonTableGen" and “AMDGPUCommonTableGen”. As said this is on LLVM 9.0.
However, on LLVM 7.0.1, the same process takes just 5-6
2019 May 05
2
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
2019 Jul 01
3
Tablegen ridiculously slow when compiling for Debug
If someone can manage it, it wouldn't be a bad thing - obviously open up
more parallelism (I don't know how much of LLVM can be built before you hit
everything that needs tblgen run - I guess libSupport and some other bits)
On Mon, Jul 1, 2019 at 12:54 PM Zakharin, Vyacheslav P via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> [resending to the whole list]
>
>
>
>
2019 May 05
2
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
2019 May 05
2
How to get CLang array alloca alignments to be smaller than 16 bytes?
Hi Tim,
I appreciate your reply, but I can’t still find any relation with “LargeArrayMinWidth” and x86 target. This variable is only in the TargetInfo.cpp and TargetInfo.h files and it’s not even in any x86 related file. I think there should be something else that causes my issue. I have my backend very advanced and already producing good assembly code, but this supposedly simple thing has got me
2019 Jul 01
2
Tablegen ridiculously slow when compiling for Debug
Hey Joan,
When looking for build support it is really useful to include a bunch of information about your build up front. Knowing that you are on macOS, and using the Xcode generator are really useful.
On macOS, BUILD_SHARED_LIBS won’t really help much because the default linker (ld64) is pretty good. Using an IDE generator and setting LLVM_USE_OPTIMIZED_TABLEGEN will kill your release builds.
2019 Nov 04
4
Debugging clang with debugger breakpoints ?
Hi David,
Thank you for your patience but I still don’t get it: I don’t see how that is a “command”, as it’s just a list of strings that state command options.
I know how to use the debugger, this is what I attempt to debug:
clang --target=msp430 -emit-llvm -c -S -Oz main.c
The debugger works fine, but only on the main thread. However breakpoints do not work with the code that was invoked
2019 Jul 02
4
Tablegen ridiculously slow when compiling for Debug
Much of this has been discussed (over many, many years) on
https://bugs.llvm.org/show_bug.cgi?id=28222
Some of the issues that were identified included:
1 - Poor tablegen dependency handling leading to unexpected rebuilds.
2 - Debug STL iterator checks taking an insane amount of time (might be
MSVC specific).
3 - Lack of parallelization of custom commands (XCode and VS builds) -
VS at least
2019 Nov 04
2
Debugging clang with debugger breakpoints ?
Hi David,
I understand what you say, but have you actually read my messages? I don’t think so,
Anyway, I will repost the question in case someone else can help.
Thanks
John
> On 4 Nov 2019, at 22:18, Zachary Turner <zturner at roblox.com> wrote:
>
>
>
> On Mon, Nov 4, 2019 at 1:11 PM Joan Lluch via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at
2019 Jun 30
2
Tablegen ridiculously slow when compiling for Debug
This is also the case with the Visual Studio generators. Custom commands in
a single cmake file essentially get written out line by line into a single
batch file that gets processed as a custom build step. In the VS case this
means that it can, for example, run X86 and Aarch64 tablegen steps in
parallel with each other but all of the individual X86 invocations get
processed serially. I can well
2019 Jul 07
2
Linker errors after installing/compiling LLVM/CLANG
Hey Joan,
Take a look at this patch, and see if it resolves your issue:
https://reviews.llvm.org/D64300 <https://reviews.llvm.org/D64300>
Thanks,
-Chris
> On Jul 7, 2019, at 3:54 PM, Chris Bieneman via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hey Joan,
>
> I looked into the Xcode build issue that you're experiencing, and it relates to a limitation in
2019 Jul 07
2
Linker errors after installing/compiling LLVM/CLANG
I don’t personally develop on Mac (i use Windows), but I have an analogous
setup there where i use ninja to build and Visual Studio for editing,
debugging, etc.
What i do, and I assume it will be the same or very similar for Xcode, is
to run cmake twice, once with Ninja, and once with VS (Xcode for you), from
separate directories. I build with the ninja one (“ninja clang” on command
line), and I