diff --git a/source/slang/slang-ir-legalize-global-values.cpp b/source/slang/slang-ir-legalize-global-values.cpp index 2da2cb888e..218c4647c8 100644 --- a/source/slang/slang-ir-legalize-global-values.cpp +++ b/source/slang/slang-ir-legalize-global-values.cpp @@ -41,7 +41,8 @@ void GlobalInstInliningContextGeneric::inlineGlobalValuesAndRemoveIfUnused(IRMod // Since certain globals that appear in the IR are considered illegal for all targets, // e.g. calls to functions, we delete globals which no longer have uses after inlining. - // TODO: Explain why tests/spirv/global-compute.slang fails if we don't exclude kIROp_SPIRVAsm + // TODO: Explain why tests/spirv/global-compute.slang fails if we don't exclude + // kIROp_SPIRVAsm if (!inst->hasUses() && inst->getOp() != kIROp_SPIRVAsm) inst->removeAndDeallocate(); } @@ -159,7 +160,10 @@ bool GlobalInstInliningContextGeneric::shouldInlineInst(IRInst* inst) return result; } -IRInst* GlobalInstInliningContextGeneric::inlineInst(IRBuilder& builder, IRCloneEnv& cloneEnv, IRInst* inst) +IRInst* GlobalInstInliningContextGeneric::inlineInst( + IRBuilder& builder, + IRCloneEnv& cloneEnv, + IRInst* inst) { IRInst* result; if (cloneEnv.mapOldValToNew.tryGetValue(inst, result)) diff --git a/source/slang/slang-ir-legalize-global-values.h b/source/slang/slang-ir-legalize-global-values.h index 8dbafc0c0f..c563b02c9c 100644 --- a/source/slang/slang-ir-legalize-global-values.h +++ b/source/slang/slang-ir-legalize-global-values.h @@ -14,14 +14,14 @@ struct GlobalInstInliningContextGeneric Dictionary m_mapGlobalInstToShouldInline; // Target-specific control over how inlining happens - virtual bool isLegalGlobalInstForTarget(IRInst* inst) =0; - virtual bool isInlinableGlobalInstForTarget(IRInst* inst) =0; - virtual bool shouldBeInlinedForTarget(IRInst* user) =0; - virtual IRInst* getOutsideASM(IRInst* beforeInst) =0; + virtual bool isLegalGlobalInstForTarget(IRInst* inst) = 0; + virtual bool isInlinableGlobalInstForTarget(IRInst* inst) = 0; + virtual bool shouldBeInlinedForTarget(IRInst* user) = 0; + virtual IRInst* getOutsideASM(IRInst* beforeInst) = 0; // Inline global values that can't represented by the target to their use sites. // If this leaves any global unused, then remove it. - void inlineGlobalValuesAndRemoveIfUnused(IRModule * module); + void inlineGlobalValuesAndRemoveIfUnused(IRModule* module); // Opcodes that can exist in global scope, as long as the operands are. bool isLegalGlobalInst(IRInst* inst); diff --git a/source/slang/slang-ir-spirv-legalize.cpp b/source/slang/slang-ir-spirv-legalize.cpp index 1618b639aa..c9764b2032 100644 --- a/source/slang/slang-ir-spirv-legalize.cpp +++ b/source/slang/slang-ir-spirv-legalize.cpp @@ -11,8 +11,8 @@ #include "slang-ir-glsl-legalize.h" #include "slang-ir-insts.h" #include "slang-ir-layout.h" -#include "slang-ir-legalize-mesh-outputs.h" #include "slang-ir-legalize-global-values.h" +#include "slang-ir-legalize-mesh-outputs.h" #include "slang-ir-loop-unroll.h" #include "slang-ir-lower-buffer-element-type.h" #include "slang-ir-peephole.h" @@ -1591,7 +1591,7 @@ struct SPIRVLegalizationContext : public SourceEmitterBase } } - struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric + struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric { bool isLegalGlobalInstForTarget(IRInst* inst) override { @@ -1602,10 +1602,10 @@ struct SPIRVLegalizationContext : public SourceEmitterBase { switch (inst->getOp()) { - case kIROp_SPIRVAsm: - return true; - default: - break; + case kIROp_SPIRVAsm: + return true; + default: + break; } if (as(inst)) diff --git a/source/slang/slang-ir-wgsl-legalize.cpp b/source/slang/slang-ir-wgsl-legalize.cpp index 6b89b45025..afdf412b13 100644 --- a/source/slang/slang-ir-wgsl-legalize.cpp +++ b/source/slang/slang-ir-wgsl-legalize.cpp @@ -1,8 +1,8 @@ #include "slang-ir-wgsl-legalize.h" #include "slang-ir-insts.h" -#include "slang-ir-legalize-varying-params.h" #include "slang-ir-legalize-global-values.h" +#include "slang-ir-legalize-varying-params.h" #include "slang-ir-util.h" #include "slang-ir.h" #include "slang-parameter-binding.h" @@ -1588,7 +1588,7 @@ struct LegalizeWGSLEntryPointContext } }; -struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric +struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric { bool isLegalGlobalInstForTarget(IRInst* /* inst */) override {