[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-12-18 Thread Iain Sandoe via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbd7f4c561f5e: [C++20][Modules] Elide unused guard variables in Itanium ABI moduleā€¦ (authored by iains). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-12-17 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 483770. iains added a comment. rebased, amended a comment as suggested Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134589/new/ https://reviews.llvm.org/D134589 Files: clang/lib/CodeGen/CGDeclCXX.cpp

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-10-17 Thread Nathan Sidwell via Phabricator via cfe-commits
urnathan added a comment. It occurs to me that for systems that lack dynamic initialization (like PTX), it is trivial to implement the 'don't call NOP module inits', because we know that there can be no non-nop inits. Any code emission that tries to create a global init fn with contents will

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-10-11 Thread Nathan Sidwell via Phabricator via cfe-commits
urnathan accepted this revision. urnathan added a comment. This revision is now accepted and ready to land. This is ok, but see the note I added about object-file compatibility. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:646-647 + If there are no initalizers at all (and

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-10-01 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 464502. iains edited the summary of this revision. iains added a comment. rebased and updated to elide the guard only for the case of no inits _and_ no imports. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-26 Thread Iain Sandoe via Phabricator via cfe-commits
iains planned changes to this revision. iains added a comment. So, in light of these comments; - It seems that there is one case where I //can// elide the guard - where the init is completely empty (including of calls to imported module inits) - otherwise, I need to investigate what is needed

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-26 Thread Nathan Sidwell via Phabricator via cfe-commits
urnathan added a comment. Richard & I discussed this, and decided it was a bad idea, as it means we could have an O(N^2) initialization walk, rather than O(N). IIUC this is being motivated by NVPTX, which cannot support dynamically initialized global vars. But in that case we know all the

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-24 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. thanks for the review. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:690-695 + // If we have an empty initializer then we do not want to create a guard var. + // 'Empty' needs only to apply to init functions that we call directly, calls + // to imported

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-24 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 462689. iains marked 3 inline comments as done. iains edited the summary of this revision. iains added a comment. address review comments, minor amendments to description. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-24 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:690-695 + // If we have an empty initializer then we do not want to create a guard var. + // 'Empty' needs only to apply to init functions that we call directly, calls + // to imported module

[PATCH] D134589: [C++20][Modules] Elide unused guard variables in Itanium ABI module initializers.

2022-09-24 Thread Iain Sandoe via Phabricator via cfe-commits
iains created this revision. Herald added a project: All. iains added a reviewer: urnathan. iains added a subscriber: clang-modules. iains published this revision for review. Herald added a project: clang. Herald added a subscriber: cfe-commits. For the Itanium ABI, we emit an initializer for