[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-07-20 Thread wanglei via Phabricator via cfe-commits
wangleiat abandoned this revision. wangleiat added a comment. We have decided to keep it unchanged. Thank you, everyone. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151298/new/ https://reviews.llvm.org/D151298

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. As far as I'm concerned as editor of the Itanium ABI, the ABI treatment of trivial-for-the-purposes-of-calls classes is purely a psABI matter, and the Itanium ABI's wording around empty classes is merely a suggestion if the psABI doesn't have more specific rules

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. If you are really determined to do this, then OK. I'm in a very bad mood and I don't want to spend my mental strength on debating (esp. on a corner case unlikely to affect "real" code) anymore. But remember to add a entry in GCC 14 changes.html, and test this thing:

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: efriedma, rjmccall. aaron.ballman added a comment. Adding codegen code owners as reviewers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151298/new/ https://reviews.llvm.org/D151298

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread WÁNG Xuěruì via Phabricator via cfe-commits
xen0n added a comment. FYI, in the matching GCC patch discussion it was suggested that such a treatment wouldn't be necessary in principle. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. In D151298#4367620 , @wangleiat wrote: If we want to ignore empty structures, it is not enough to only modify psABI, because the current implementations of gcc and clang do not ignore empty structures in all

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread wanglei via Phabricator via cfe-commits
wangleiat added a comment. >>> If we want to ignore empty structures, it is not enough to only modify >>> psABI, because the current implementations of gcc and clang do not ignore >>> empty structures in all cases. For example: >>> >>> struct { struct{}; int i; }; // in this case, the empty

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. In D151298#4367496 , @xry111 wrote: > In D151298#4367458 , @wangleiat > wrote: > >>> I think the paragraph means: >>> >>> class Empty {}; >>> int test(Empty empty, int a); >>> >>>

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. In D151298#4367458 , @wangleiat wrote: >> I think the paragraph means: >> >> class Empty {}; >> int test(Empty empty, int a); >> >> Then we should put `a` into `a1`, not `a0`. And we are indeed doing so. > > yes. with this

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread wanglei via Phabricator via cfe-commits
wangleiat added a comment. > I think the paragraph means: > > class Empty {}; > int test(Empty empty, int a); > > Then we should put `a` into `a1`, not `a0`. And we are indeed doing so. yes. with this patch, `a` will be passed with `a1` register. > I mean now GCC and Clang have the same

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. In D151298#4367349 , @wangleiat wrote: > In D151298#4367225 , @xry111 wrote: > >> In D151298#4367215 , @wangleiat >> wrote: >> >>> In

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread wanglei via Phabricator via cfe-commits
wangleiat added a comment. In D151298#4367225 , @xry111 wrote: > In D151298#4367215 , @wangleiat > wrote: > >> In D151298#4367163 , @xry111 wrote: >> >>> Blocking this

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. In D151298#4367215 , @wangleiat wrote: > In D151298#4367163 , @xry111 wrote: > >> Blocking this as it's a deliberate decision made in D132285 >> . >> >>

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread wanglei via Phabricator via cfe-commits
wangleiat added a comment. In D151298#4367163 , @xry111 wrote: > Blocking this as it's a deliberate decision made in D132285 > . > > Is there any imperative reason we must really pass the empty struct? The C++ >

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 added a comment. Note that we are using the "de-facto" ABI throwing away this empty struct since the first release of GCC supporting LoongArch, and also Clang. So is there an imperative reason we must change it? And IIUC we've agreed to revise the ABI since Apr 2022 for this, but

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread Xi Ruoyao via Phabricator via cfe-commits
xry111 requested changes to this revision. xry111 added a comment. This revision now requires changes to proceed. Blocking this as it's a deliberate decision made in D132285 . Is there any imperative reason we must really pass the empty struct? The C++

[PATCH] D151298: [clang][LoongArch] Fix the calling convention for empty struct in C++ mode

2023-05-24 Thread wanglei via Phabricator via cfe-commits
wangleiat created this revision. wangleiat added reviewers: SixWeining, xen0n, xry111, gonglingqin. Herald added a project: All. wangleiat requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Prior to this patch, paramter or return value whose