[llvm] [DirectX backend] generate ISG1, OSG1 part for compute shader (PR #90508)
Chris B via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 14:06:46 PDT 2024
================
@@ -104,6 +112,38 @@ GlobalVariable *DXContainerGlobals::computeShaderHash(Module &M) {
return GV;
}
+GlobalVariable *DXContainerGlobals::buildContainerGlobal(
+ Module &M, Constant *Content, StringRef Name, StringRef SectionName) {
+ auto *GV = new llvm::GlobalVariable(
+ M, Content->getType(), true, GlobalValue::PrivateLinkage, Content, Name);
+ GV->setSection(SectionName);
+ GV->setAlignment(Align(4));
+ return GV;
+}
+
+GlobalVariable *DXContainerGlobals::buildSingature(Module &M, Signature &Sig,
+ StringRef Name,
+ StringRef SectionName) {
+ SmallString<256> Data;
+ raw_svector_ostream OS(Data);
+ Sig.write(OS);
+ Constant *Constant =
+ ConstantDataArray::getString(M.getContext(), Data, /*AddNull*/ false);
+ return buildContainerGlobal(M, Constant, Name, SectionName);
+}
+
+void DXContainerGlobals::addSingature(Module &M,
+ SmallVector<GlobalValue *> &Globals,
+ Triple &TT) {
----------------
llvm-beanz wrote:
TT is unused (and also reachable from the module)
https://github.com/llvm/llvm-project/pull/90508
More information about the llvm-commits
mailing list