[PATCH] D134688: MSVC AArch64 ABI: Homogeneous aggregates

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 18:48:02 PDT 2022


dblaikie created this revision.
dblaikie added reviewers: hansw, rnk.
Herald added subscribers: mstorsjo, kristof.beyls.
Herald added a project: All.
dblaikie requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fixes:
Protected members, HFA: https://godbolt.org/z/zqdK7vdKc
Private members, HFA: https://godbolt.org/z/zqdK7vdKc
Non-empty base, HFA: https://godbolt.org/z/PKTz59Wev
User-provided ctor, HFA: https://godbolt.org/z/sfrTddcW6

Existing correct cases:
Empty base class, NonHFA: https://godbolt.org/z/4veY9MWP3

- correct by accident of not allowing bases at all (see non-empty base case/fix above for counterexample)

Polymorphic: NonHFA: https://godbolt.org/z/4veY9MWP3
Trivial copy assignment, HFA: https://godbolt.org/z/Tdecj836P
Non-trivial copy assignment, NonHFA: https://godbolt.org/z/7c4bE9Whq
Non-trivial default ctor, NonHFA: https://godbolt.org/z/Tsq1EE7b7

- correct by accident of disallowing all user-provided ctors (see user-provided non-default ctor example above for counterexample)

Trivial dtor, HFA: https://godbolt.org/z/nae999aqz
Non-trivial dtor, NonHFA: https://godbolt.org/z/69oMcshb1
Empty field, NonHFA: https://godbolt.org/z/8PTxsKKMK

- true due to checking for the absence of padding (see comment in code)

After a bunch of testing, this fixes a bunch of cases that were
incorrect. Some of the tests verify the nuances of the existing
behavior/code checks that were already present.

This was mostly motivated by cleanup from/in D133817 <https://reviews.llvm.org/D133817> which itself was
motivated by D119051 <https://reviews.llvm.org/D119051>.

By removing the incorrect use of isTrivialForAArch64MSVC here & adding
more nuance to the homogeneous testing we can more safely/confidently
make changes to the isTrivialFor(AArch64)MSVC to more properly align
with its usage anyway.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134688

Files:
  clang/lib/CodeGen/MicrosoftCXXABI.cpp
  clang/test/CodeGenCXX/homogeneous-aggregates.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134688.463070.patch
Type: text/x-patch
Size: 6501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220927/bd233e9d/attachment.bin>


More information about the cfe-commits mailing list