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
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
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/
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)) &&
+
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
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)) &&
+
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
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:
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?
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:
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
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
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
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
14 matches
Mail list logo