[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Xiang Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2bdfececef43: [HLSL] Remove global ctor/dtor variable for non-lib profile. (authored by python3kgae). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/ne

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. In D133993#3840838 , @efriedma wrote: > It seems like it would be better to put the code in an LLVM IR transform > pass, if we can. It separates the concerns more clearly, and it would make > life easier for other compilers.

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. @efriedma, I think that's a great suggestion. @python3kgae, if you don't adjust this patch, can you file an issue for that so that we don't lose that feedback? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https:

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. This revision is now accepted and ready to land. It seems like it would be better to put the code in an LLVM IR transform pass, if we can. It separates the concerns more clearly, and it would make life easier for other compilers. (If yo

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-10-06 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D133993#3816526 , @efriedma wrote: > Why are we using different mechanisms for global constructors in "libraries" > vs. other code? If we need a mechanism in LLVM already, we might as well use > it all the time? To elaborate

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-26 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. In D133993#3816526 , @efriedma wrote: > Why are we using different mechanisms for global constructors in "libraries" > vs. other code? If we need a mechanism in LLVM already, we might as well use > it all the time? For lib

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-26 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Why are we using different mechanisms for global constructors in "libraries" vs. other code? If we need a mechanism in LLVM already, we might as well use it all the time? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman edited reviewers, added: rjmccall, efriedma; removed: aaron.ballman. aaron.ballman added a comment. Switching up code reviewers for the codegen questions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https://reviews.llvm

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-23 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 462624. python3kgae marked an inline comment as done. python3kgae added a comment. Rebase for allow SV_GroupIndex in lib profile Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https://reviews.llv

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked 4 inline comments as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { -

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { python3kgae wrote: > beanz wrote: > > I question

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked 3 inline comments as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { -

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:208 + // ctors/dtors added for entry. + Triple T(M.getTargetTriple()); + if (T.getEnvironment() != Triple::EnvironmentType::Library) { I question whether we should do this early or la

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-19 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 461271. python3kgae added a comment. Herald added a reviewer: aaron.ballman. Add test for dtor in lib. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https://reviews.llvm.org/D133993 Files: cl

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-19 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. We should also have a library test case that verifies that the `global_dtors` variable is kept. Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:50 void annotateHLSLResource(const VarDecl *D, llvm::GlobalVariable *GV); - void generateGlobalCtorDtorCalls

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-17 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 461014. python3kgae added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133993/new/ https://reviews.llvm.org/D133993 Files: clang/lib/CodeGen/CGHLSLRuntime.cpp clang/lib/CodeGen/CGHLS

[PATCH] D133993: [HLSL] Remove global ctor/dtor variable for non-lib profile.

2022-09-15 Thread Xiang Li via Phabricator via cfe-commits
python3kgae created this revision. python3kgae added reviewers: beanz, pow2clk, bogner. Herald added a subscriber: Anastasia. Herald added a project: All. python3kgae requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. After generated call for