-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LLVM 14 #3951
Add support for LLVM 14 #3951
Conversation
…rect asm operands
Checked on Linux.
For LLVM 14 itself, I wanted to include BOLT in our prebuilt LLVM packages, just for convenience. The README states:
but there's at least some extra runtime library for macOS (causing problems, so I noticed... ldc-developers/llvm-project@0655850) and a source file with
@JohanEngelen and whoever else is using Mac: would bumping |
I don't know much about macos versions to be honest. Edit: my macbook from 2013 is running 11.6, and I am not keen on updating the OS, so 10.12 sounds old even to me. |
Thx, 10.12 it'll be then. |
Tested by lit-test PGO/profile_rt_calls.d.
Ouch, the LLVM 14 optimizer seems too aggressive. Derived from dmd-testsuite's import core.stdc.stdio;
void foo14846(Dg)(scope Dg code)
{
code();
}
void test14846()
{
int x;
struct S
{
this(int n) { x = n; }
~this() { printf("dtor: %p, %p\n", &this, &x); x = 99; }
}
foo14846({ S* p = new S(1); });
}
void main()
{
test14846();
} This is what optimized define i32 @_Dmain({ i64, { i64, i8* }* } %unnamed) #5 {
%.gc_struct.i.i = tail call noalias i8* @_d_newitemT(%object.TypeInfo* bitcast (%object.TypeInfo_Struct* @_D28TypeInfo_S3mod9test14846FZ1S6__initZ to %object.TypeInfo*)) #1 ; [#uses = 0]
ret i32 0
} So it does the Edit: With LLVM 13.0.1: define i32 @_Dmain({ i64, { i64, i8* }* } %unnamed) #5 {
%.frame.i = tail call noalias i8* @_d_allocmemory(i64 4) #1 ; [#uses = 2]
%x.i = bitcast i8* %.frame.i to i32* ; [#uses = 2]
store i32 0, i32* %x.i, align 4
%.gc_struct.i.i = tail call noalias i8* @_d_newitemT(%object.TypeInfo* bitcast (%object.TypeInfo_Struct* @_D28TypeInfo_S3mod9test14846FZ1S6__initZ to %object.TypeInfo*)) #1 ; [#uses = 1]
%.vthis.i.i = bitcast i8* %.gc_struct.i.i to i8** ; [#uses = 1]
store i8* %.frame.i, i8** %.vthis.i.i, align 8
store i32 1, i32* %x.i, align 4
ret i32 0
} |
Perhaps it is because of the |
Right on, Johan - removing the From https://llvm.org/docs/LangRef.html#parameter-attributes:
I think that should still apply here? I mean even malloc will need some book-keeping for the allocated chunks... |
Filed llvm/llvm-project#54740. |
…n prototypes As that's invalid according to llvm/llvm-project#54740, and a problem since LLVM 14 at least.
I think the reasoning is that |
Yeah that makes sense. 👍 (plus the GC might access it during scanning) |
Tested by lit-test PGO/profile_rt_calls.d.
For the v1.29 release.
I propose keeping v13.0.1 for the prebuilt packages of the LDC v1.29 release, so that we don't skip LLVM 13, and to postpone v14 to LDC v1.30 (by simply reverting the last commit; CI is green with LDC-LLVM 14.0.0 as shown by the 2nd-latest commit). |
No description provided.