This is an archive of the discontinued LLVM Phabricator instance.

[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially relocatable"".
ClosedPublic

Authored by devin.jeanpierre on Feb 4 2022, 9:58 AM.

Details

Summary

This reverts commit 852afed5e0200b70047c28ccf4424a17089d17b0.

Changes since D114732:

On PS4, we reverse the expectation that classes whose constructor is deleted are not trivially relocatable. Because, at the moment, only classes which are passed in registers are trivially relocatable, and PS4 allows passing in registers if the copy constructor is deleted, the original assertions were broken on PS4.

(This is kinda similar to DR1734.)

Diff Detail

Event Timeline

devin.jeanpierre requested review of this revision.Feb 4 2022, 9:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 9:58 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gribozavr2 accepted this revision.Feb 4 2022, 10:01 AM

Approving the delta for the PS4 fix (relying or @rsmith 's approval for the actual patch -- https://reviews.llvm.org/D114732).

This revision is now accepted and ready to land.Feb 4 2022, 10:01 AM
This revision was landed with ongoing or failed builds.Feb 4 2022, 11:17 AM
This revision was automatically updated to reflect the committed changes.
Manna added a subscriber: Manna.EditedMar 18 2022, 11:18 AM

LIT test (SemaCXX/attr-trivial-abi.cpp) is failing for x86 build of clang. The same failures are happening with our downstream X86 clang build.

error: 'error' diagnostics seen but not expected:

File ...\llorg\llvm\clang\test\SemaCXX\attr-trivial-abi.cpp Line 13: static_assert failed due to requirement '!__is_trivially_relocatable(a<int>)' ""
File ....\llorg\llvm\clang\test\SemaCXX\attr-trivial-abi.cpp Line 141: static_assert failed due to requirement '!__is_trivially_relocatable(deletedCopyMoveConstructor::CopyDeleted)' ""
File ....\llorg\llvm\clang\test\SemaCXX\attr-trivial-abi.cpp Line 167: static_assert failed due to requirement '!__is_trivially_relocatable(deletedCopyMoveConstructor::S20)' ""

3 errors generated. error: command failed with exit status: 1--****


Failed Tests (1):

Clang :: SemaCXX/attr-trivial-abi.cpp

Testing Time: 2.11s

Failed: 1

The test might need to be updated so that shouldn't run with x86 build. @devin.jeanpierre, could you please look at the test failures? Thanks

Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2022, 11:18 AM

LIT test (SemaCXX/attr-trivial-abi.cpp) is failing for x86 build of clang. The same failures are happening with our downstream X86 clang build.
[...]
The test might need to be updated so that shouldn't run with x86 build. @devin.jeanpierre, could you please look at the test failures? Thanks

A couple questions -- was that failure introduced by this change, or a different change? Also, what target triple, so that I can reproduce? (New to clang development...)

(I am hoping that I'm not expected to roll back this change after it's been in for a month.)

LIT test (SemaCXX/attr-trivial-abi.cpp) is failing for x86 build of clang. The same failures are happening with our downstream X86 clang build.
[...]
The test might need to be updated so that shouldn't run with x86 build. @devin.jeanpierre, could you please look at the test failures? Thanks

A couple questions -- was that failure introduced by this change, or a different change? Also, what target triple, so that I can reproduce? (New to clang development...)

(I am hoping that I'm not expected to roll back this change after it's been in for a month.)

Thanks for the quick response!

was that failure introduced by this change, or a different change?

Yes, the failures were introduced by this change.

lf so, what target triple, so that I can reproduce? (New to clang development...)

You can reproduce the test failure if you checkout 32 bit clang compiler.

lf so, what target triple, so that I can reproduce? (New to clang development...)

You can reproduce the test failure if you checkout 32 bit clang compiler.

Please bear with me, how do I do this? :(

Manna added a comment.EditedMar 18 2022, 12:15 PM

lf so, what target triple, so that I can reproduce? (New to clang development...)

You can reproduce the test failure if you checkout 32 bit clang compiler.

Please bear with me, how do I do this? :(

You can download an already built 32bit version of the compiler.

This is the link for the doc. You can look at paragraph "Using Visual Studio"
This is the command: cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 15 2017" -A Win32 -Thost=x64 ..\llvm

This is the doc:Clang - Getting Started (llvm.org)
https://clang.llvm.org/get_started.html#:~:text=The%20following%20details%20setting%20up%20for%20and%20building,for%20information%20on%20running%20regression%20tests%20on%20Windows

Hello, @devin.jeanpierre! I'm wondering if we should revert this while you investigate the fix, or do you think you'll have this solved sometime today? Thanks!

Please revert it, I don't have easy access to a Windows machine at work so am struggling with the reproduction instructions.

This has failed twice, and this time with a one month delay! Is there any way to run and confirm all tests pass before I try to merge again?

Please revert it, I don't have easy access to a Windows machine at work so am struggling with the reproduction instructions.

Thanks for letting us know! @Manna -- I'll let you handle the revert unless you need some help from me.

This has failed twice, and this time with a one month delay! Is there any way to run and confirm all tests pass before I try to merge again?

It seems we have no build bots testing the x86 configuration. I've brought the issue up internally at Intel to see if we can supply a build bot to cover that configuration so that there's a much earlier notification to this kind of issue.

This comment was removed by devin.jeanpierre.