Skip to content

Commit 33abef1

Browse files
jgu222sys_zuul
authored andcommitted
Minor Refactoring
Change-Id: I53ec3cedc8c7131c184da1fe9ae25fe43d0d31a8
1 parent 3e5c150 commit 33abef1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

IGC/Compiler/CISACodeGen/DriverInfo.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ namespace IGC
259259
/// Allow aggressive vector value aliasing
260260
virtual bool EnableVecAliasing() const { return false; }
261261

262+
/// Restrict dessa aliasing level. -1 : no restriction; max level otherwise.
263+
virtual int DessaAliasLevel() const { return -1; }
264+
262265
/// Rounding mode used for DP emulated function, defaults to Round to nearest
263266
virtual unsigned DPEmulationRoundingMode() const { return 0; }
264267

IGC/Compiler/CodeGenContext.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,15 @@ namespace IGC
675675
"IGC::PositionOnlyVertexShader") != nullptr;
676676
}
677677

678+
void CodeGenContext::setFlagsPerCtx()
679+
{
680+
if (m_DriverInfo.DessaAliasLevel() != -1) {
681+
if ((int)IGC_GET_FLAG_VALUE(EnableDeSSAAlias) > m_DriverInfo.DessaAliasLevel())
682+
{
683+
IGC_SET_FLAG_VALUE(EnableDeSSAAlias, m_DriverInfo.DessaAliasLevel());
684+
}
685+
}
686+
}
678687

679688

680689
}

IGC/Compiler/CodeGenPublic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ namespace IGC
777777
/// input: IGC MetaData Utils
778778
IGC::IGCMD::MetaDataUtils* m_pMdUtils = nullptr;
779779
IGC::ModuleMetaData* modMD = nullptr;
780+
781+
virtual void setFlagsPerCtx();
780782
public:
781783
CodeGenContext(
782784
ShaderType _type, ///< shader type
@@ -805,6 +807,9 @@ namespace IGC
805807
instrStat[i][j] = 0;
806808
}
807809
}
810+
811+
// Per context flag adjustment
812+
setFlagsPerCtx();
808813
}
809814

810815
CodeGenContext(CodeGenContext&) = delete;

0 commit comments

Comments
 (0)