-
-
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 13 & bump LDC-LLVM to v13.0.1 #3842
Conversation
797d1c7
to
2eee309
Compare
a2303d5
to
e16fce8
Compare
Issue 1 - atomic lib calls (edit: fixed)Some atomic ops on x86 seem not to be lowered to instructions anymore, but to library function calls. At least on Linux i686 and MSVC x64. E.g., this: void main()
{
import core.atomic;
shared long* ptr;
cas(ptr, 0L, 1L);
} newly fails to link on Linux without Issue 2 - cloning debuginfos (edit: fixed)New assertions when cloning a function with debuginfos for the MSVC Lines 990 to 991 in 3902850
I've tried the built-in LLVM Issue 3 - lit-test regressions
|
a8795d5
to
73fc56e
Compare
[Preliminary support extracted to #3846.] |
The atomic lib calls is perhaps caused by not satisfying alignment requirements (we should explicitly specify them?) ? Some additional info about alignment here: https://reviews.llvm.org/D47589 |
I'd need to test it, but according to the v13 docs, the default alignment is the pointee size; from https://releases.llvm.org/13.0.0/docs/LangRef.html#cmpxchg-instruction:
|
gen/tocall.cpp
Outdated
@@ -511,7 +511,7 @@ bool DtoLowerMagicIntrinsic(IRState *p, FuncDeclaration *fndecl, CallExp *e, | |||
auto ret = | |||
p->ir->CreateAtomicCmpXchg(ptr, cmp, val, | |||
#if LDC_LLVM_VER >= 1300 | |||
LLMaybeAlign(getABITypeAlign(val->getType())), | |||
llvm::MaybeAlign(), // default alignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the alignment regression - e.g., long.alignof
is 4 for 32-bit x86...
cbea0c8
to
80ecb88
Compare
3220ddf
to
8a86ce5
Compare
Seems like it, I've got a single |
6971184
to
1de7d99
Compare
Rebased; still blocked
|
I could reproduce strange dmd-testsuite failures with gold on Ubuntu20. Merged current LLVM |
Hmm, the vanilla 13.0.0 GH Actions job now seems to pass consistently with its gold linker. The CI image version hasn't changed, the runner has - no idea. Edit: Oh and the Win32 lld regression was apparently fixed by the latest bump too. |
Fixes `runnable/ldc_cabi1.d` with enabled optimizations, where LLVM 13 apparently uses a movaps for a struct with 4 float members (and a natural alignment of 4) without explicit alignment.
To work around the inconsistent CI results with vanilla LLVM v13.0.0 and the ld.gold linker. There is no vanilla v13.0.1 package yet.
The GH Actions LLVM 13 job with old ld.gold is driving me somewhat nuts. Yesterday, it went from green to red inside an hour without any real change. I've then switched from vanilla v13.0.0 to just-released LDC-LLVM v13.0.1, and the first attempt led to some (different) failures, incl. something hanging for a long time. Retried today, green. So these failures seem totally indeterministic. I'll go ahead and merge this now that v13.0.1 is available; if the job failure is frequent, I'll do something about it. |
No description provided.