Skip to content
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

Upgrade front-end & libs to v2.089.0-beta.1 #3192

Merged
merged 21 commits into from
Oct 22, 2019

Conversation

kinke
Copy link
Member

@kinke kinke commented Oct 18, 2019

No description provided.

@kinke
Copy link
Member Author

kinke commented Oct 18, 2019

Early showstoppers (after the usual C++ header regressions):

druntime-ldc-unittest-debug.lib(atomic.obj) : error LNK2019: unresolved external symbol _D4core8lifetime__T4moveTSQy6atomic__T10TailSharedTOSQBzQBc20__unittest_L1210_C24FNaNbNfZ2S2ZQCdZQDaFNaNbNiNfMNkKQDkZQDo referenced in function _D4core6atomic__T10atomicLoadVEQBdQBb11MemoryOrderi5TSQCaQBy20__unittest_L1210_C24FNaNbNfZ2S2ZQCzFNaNbNiNeKOxSQEeQEcQCeFNaNbNfZQBlZSQFaQEy__T10TailSharedTOSQFyQFwQDyFNaNbNfZQDfZQBk
druntime-ldc-unittest-debug.lib(atomic.obj) : error LNK2019: unresolved external symbol _D4core8lifetime__T4moveTSQy6atomic__T10TailSharedTOSQBzQBc20__unittest_L1210_C24FNaNbNfZ2S3ZQCdZQDaFNaNbNiNfMNkKQDkZQDo referenced in function _D4core6atomic__T10atomicLoadVEQBdQBb11MemoryOrderi5TSQCaQBy20__unittest_L1210_C24FNaNbNfZ2S3ZQCzFNaNbNiNeKOxSQEeQEcQCeFNaNbNfZQBlZSQFaQEy__T10TailSharedTOSQFyQFwQDyFNaNbNfZQDfZQBk
druntime-ldc-unittest-debug.lib(atomic.obj) : error LNK2019: unresolved external symbol _D4core8lifetime__T4moveTOCQz6atomic20__unittest_L1210_C24FNaNbNfZ1CZQByFNaNbNiNfMNkKOQCiZOQCn referenced in function _D4core6atomic__T10atomicLoadVEQBdQBb11MemoryOrderi5TCQCaQBy20__unittest_L1210_C24FNaNbNfZ1CZQCyFNaNbNiNeKOxCQEdQEbQCdFNaNbNfZQBkZOCQFaQEyQDaFNaNbNfZQCh

An LDC-specific unittest tests an `alias this` struct...
And more importantly, this eliminates the linker errors for the druntime
test runners about undefined core.lifetime.move() template instantiations.
Fixes dmd-testsuite's fail_compilation/test1021.d.
LDC/LLVM doesn't support conflicting function declarations with the same
mangled name in the same translation unit.
As tested by lit-test PGO/uninstrumented_main.d.
[The automagic C entry point has moved from the compiler to druntime.]
Conflicts:
	runtime/druntime
@kinke
Copy link
Member Author

kinke commented Oct 18, 2019

The druntime-test-runner linker errors are worked around, but the underlying issue of course persists.

@kinke
Copy link
Member Author

kinke commented Oct 19, 2019

Single remaining failure for x86, failing runnable/interpret.d, is due to a smelly AST change:

class Test109C { this(){ this.c = this; } Test109C c; }
const t109c = new Test109C();

void main()
{
    assert(t109c.c is t109c);
}

Previous -vcg-ast output for the global:

const const(Test109C) t109c = Test109C(Test109C(<recursion>));

New (where we end up with 2 static objects):

const const(Test109C) t109c = Test109C(Test109C(Test109C(<recursion>)));

@kinke
Copy link
Member Author

kinke commented Oct 19, 2019

@rainers: Maybe you can help - our code here relies on the identity of the ClassReferenceExp.value (a StructLiteralExp); i.e., if 2 static class references share the identical struct literal, we use the same global.

Previously:

* * DtoConstExpInit(targetType = const(Test109C), exp = Test109C(Test109C(<recursion>)))
* * * ClassReferenceExp::toConstElem: Test109C(Test109C(<recursion>)) @ const(Test109C)
* * * * Getting initializer for: c
* * * * * ClassReferenceExp::toConstElem: Test109C(Test109C(<recursion>)) @ current.Test109C
* * * * * * Using existing global: @.classref = internal global %current.Test109C

The 1st inner class reference now apparently uses another StructLiteralExp:

* * DtoConstExpInit(targetType = const(Test109C), exp = Test109C(Test109C(Test109C(<recursion>))))
* * * ClassReferenceExp::toConstElem: Test109C(Test109C(Test109C(<recursion>))) @ const(Test109C)
* * * * Getting initializer for: c
* * * * * ClassReferenceExp::toConstElem: Test109C(Test109C(<recursion>)) @ current.Test109C
* * * * * * Getting initializer for: c
* * * * * * * ClassReferenceExp::toConstElem: Test109C(Test109C(<recursion>)) @ current.Test109C
* * * * * * * * Using existing global: @.classref.1 = internal global %current.Test109C

I'm thinking it might have to do with the new CTFE regions and hope you have some insight into that.

@kinke
Copy link
Member Author

kinke commented Oct 19, 2019

@rainers: Never mind, StructLiteralExp.origin seems to do just fine.

@rainers
Copy link
Contributor

rainers commented Oct 20, 2019

@rainers: Never mind, StructLiteralExp.origin seems to do just fine.

Good to hear, I had no idea what this all meant ;-)

@kinke kinke force-pushed the merge-2.089 branch 4 times, most recently from a6be4c4 to 680a8fc Compare October 20, 2019 12:30
@kinke
Copy link
Member Author

kinke commented Oct 20, 2019

Hmm, for Shippable on AArch64, negating a NaN yields the same NaN, the sign bit isn't flipped, regardless of precision (float/double/real). LLVM 10 will introduce an fneg instruction, which replaces the current -0 - NaN implementation and which should fix exactly this corner case, according to http://lists.llvm.org/pipermail/llvm-dev/2018-September/126017.html.

Floating-point negation is currently implemented as `-0 - x` (in
llvm::IRBuilder::CreateFNeg), which apparently depends on hardware for
NaN inputs. LLVM 10 will introduce an fneg instruction which is supposed
to well-define this corner case, see
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126017.html.
@kinke kinke force-pushed the merge-2.089 branch 2 times, most recently from 631971e to 5e7d5ec Compare October 20, 2019 15:44
@kinke kinke merged commit 908784a into ldc-developers:master Oct 22, 2019
@kinke kinke deleted the merge-2.089 branch October 22, 2019 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants