Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
slangbot authored and aleino-nv committed Dec 10, 2024
1 parent 466f3c6 commit e57ab0e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
5 changes: 4 additions & 1 deletion source/slang/slang-ir-legalize-global-values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,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))
Expand Down
10 changes: 5 additions & 5 deletions source/slang/slang-ir-legalize-global-values.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ struct GlobalInstInliningContextGeneric
Dictionary<IRInst*, bool> 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);
Expand Down
12 changes: 6 additions & 6 deletions source/slang/slang-ir-spirv-legalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1591,7 +1591,7 @@ struct SPIRVLegalizationContext : public SourceEmitterBase
}
}

struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric
struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric
{
bool isLegalGlobalInstForTarget(IRInst* inst) override
{
Expand All @@ -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<IRSPIRVAsmInst>(inst))
Expand Down
4 changes: 2 additions & 2 deletions source/slang/slang-ir-wgsl-legalize.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -1588,7 +1588,7 @@ struct LegalizeWGSLEntryPointContext
}
};

struct GlobalInstInliningContext: public GlobalInstInliningContextGeneric
struct GlobalInstInliningContext : public GlobalInstInliningContextGeneric
{
bool isLegalGlobalInstForTarget(IRInst* /* inst */) override
{
Expand Down

0 comments on commit e57ab0e

Please sign in to comment.