Skip to content

Commit

Permalink
Add DriverInfo flag to disable hoisting of convergent instructions
Browse files Browse the repository at this point in the history
Add a knob to force adding`GenIntrinsicsTTI` to codegen passes.
  • Loading branch information
mmerecki authored and igcbot committed Oct 5, 2023
1 parent 8a46432 commit b0ed3e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions IGC/Compiler/CISACodeGen/DriverInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ namespace IGC
// Informs if LSC immediate global offset for A32 is supported
virtual bool supportsLSCImmediateGlobalBaseOffsetForA32() const { return true; }

// If enabled IGC must not hoist convergent instructions.
virtual bool DisableConvergentInstructionsHoisting() const { return false; }

protected:
bool autoGRFSelection = false;
};
Expand Down
7 changes: 5 additions & 2 deletions IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,11 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
ctx.m_instrTypes.hasUnmaskedRegion) {
IGC_SET_FLAG_VALUE(allowLICM, false);
}

if (IGC_IS_FLAG_ENABLED(ForceAllPrivateMemoryToSLM) ||
bool disableConvergentInstructionsHoisting =
ctx.m_DriverInfo.DisableConvergentInstructionsHoisting() &&
ctx.m_instrTypes.numWaveIntrinsics > 0;
if (disableConvergentInstructionsHoisting ||
IGC_IS_FLAG_ENABLED(ForceAllPrivateMemoryToSLM) ||
IGC_IS_FLAG_ENABLED(ForcePrivateMemoryToSLMOnBuffers))
{
DummyPass* dummypass = new DummyPass();
Expand Down

0 comments on commit b0ed3e0

Please sign in to comment.