diff --git a/source/slang/slang-ir-legalize-global-values.cpp b/source/slang/slang-ir-legalize-global-values.cpp index 767459655b..e65a5c4513 100644 --- a/source/slang/slang-ir-legalize-global-values.cpp +++ b/source/slang/slang-ir-legalize-global-values.cpp @@ -143,7 +143,8 @@ bool GlobalInstInliningContextGeneric::shouldInlineInstImpl(IRInst* inst) // better inline it since we'll be removing the ancestor. bool ancestorShouldBeInlined = false; for (IRInst* ancestor = inst->parent; ancestor != nullptr; ancestor = ancestor->parent) - if (m_mapGlobalInstToShouldInline.tryGetValue(inst, ancestorShouldBeInlined) && ancestorShouldBeInlined) + if (m_mapGlobalInstToShouldInline.tryGetValue(inst, ancestorShouldBeInlined) && + ancestorShouldBeInlined) break; if (ancestorShouldBeInlined) return true; @@ -170,9 +171,13 @@ 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) { - // We rely on this dictionary in order to force inlining of any nodes with that should be inlined + // We rely on this dictionary in order to force inlining of any nodes with that should be + // inlined SLANG_ASSERT(m_mapGlobalInstToShouldInline[inst]); IRInst* 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 {