[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-09 Thread Chris Bieneman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd3c54a172d48: [HLSL] Call global constructors inside entry (authored by beanz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132977/new/ https://reviews.llvm.org/D132977

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-08 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 458867. beanz added a comment. Adding Sema errors for specifying initializer priority, and a test case for library shaders. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132977/new/

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:167-170 +assert(cast(CS->getOperand(0))->getValue() == 65535 && + "HLSL doesn't support setting priority for global ctors."); +assert(isa(CS->getOperand(2)) && +

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-08 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:167-170 +assert(cast(CS->getOperand(0))->getValue() == 65535 && + "HLSL doesn't support setting priority for global ctors."); +assert(isa(CS->getOperand(2)) && + "HLSL

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:167-170 +assert(cast(CS->getOperand(0))->getValue() == 65535 && + "HLSL doesn't support setting priority for global ctors."); +assert(isa(CS->getOperand(2)) && +

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-07 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/CodeGenHLSL/GlobalConstructors.hlsl:3 + +RWBuffer Buffer; + aaron.ballman wrote: > Can you also add a test using `__attribute__((constructor))`? And probably > one using `__attribute__((destructor))` at some

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-07 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 458542. beanz added a comment. Adding test coverage for `__attribute__((constructor))` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132977/new/ https://reviews.llvm.org/D132977 Files:

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/CodeGenHLSL/GlobalConstructors.hlsl:3 + +RWBuffer Buffer; + Can you also add a test using `__attribute__((constructor))`? And probably one using `__attribute__((destructor))` at some point as well?

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-09-06 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:151 + llvm::Module = CGM.getModule(); + const auto *GlobalCtors = M.getNamedGlobal("llvm.global_ctors"); + if (!GlobalCtors) python3kgae wrote: > beanz wrote: > > python3kgae wrote:

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-08-30 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:151 + llvm::Module = CGM.getModule(); + const auto *GlobalCtors = M.getNamedGlobal("llvm.global_ctors"); + if (!GlobalCtors) beanz wrote: > python3kgae wrote: > > Don't need

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-08-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:151 + llvm::Module = CGM.getModule(); + const auto *GlobalCtors = M.getNamedGlobal("llvm.global_ctors"); + if (!GlobalCtors) python3kgae wrote: > Don't need to generate CtorCalls

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-08-30 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:151 + llvm::Module = CGM.getModule(); + const auto *GlobalCtors = M.getNamedGlobal("llvm.global_ctors"); + if (!GlobalCtors) Don't need to generate CtorCalls for lib profile

[PATCH] D132977: [HLSL] Call global constructors inside entry

2022-08-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: aaron.ballman, bogner, python3kgae, pow2clk, tex3d, eli.friedman. Herald added a subscriber: Anastasia. Herald added a project: All. beanz requested review of this revision. Herald added a project: clang. HLSL doesn't have a runtime loader