Skip to content

Commit 942f97e

Browse files
lizhengxingigcbot
authored andcommitted
Changes in code.
1 parent 7b55e1a commit 942f97e

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,21 @@ class CPlatform {
157157
}
158158

159159
bool isPVC() const { return (m_platformInfo.eProductFamily == IGFX_PVC); }
160+
161+
// Narrowing of bitcasted vector loads (see VectorPreProcess). An explicitly
162+
// set EnableBitcastedLoadNarrowing regkey (enable or disable) always takes
163+
// precedence.
164+
bool enableBitcastedLoadNarrowing() const {
165+
return IGC_IS_FLAG_ENABLED(EnableBitcastedLoadNarrowing);
166+
}
167+
168+
// Narrowing of bitcasted vector loads down to a scalar load (see
169+
// VectorPreProcess). An explicitly set EnableBitcastedLoadNarrowingToScalar
170+
// regkey always takes precedence.
171+
bool enableBitcastedLoadNarrowingToScalar() const {
172+
return IGC_IS_FLAG_ENABLED(EnableBitcastedLoadNarrowingToScalar);
173+
}
174+
160175
bool isCoreXE2() const { return (m_platformInfo.eRenderCoreFamily == IGFX_XE2_HPG_CORE); }
161176

162177
bool isCoreXE3() const {

IGC/Compiler/CISACodeGen/VectorPreProcess.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ Instruction *VectorPreProcess::simplifyLoadStore(Instruction *Inst) {
13811381
if (BC) {
13821382
IGCLLVM::FixedVectorType *DstVTy = dyn_cast<IGCLLVM::FixedVectorType>(BC->getType());
13831383
IGCLLVM::FixedVectorType *SrcVTy = dyn_cast<IGCLLVM::FixedVectorType>(BC->getOperand(0)->getType());
1384-
if (IGC_IS_FLAG_DISABLED(EnableBitcastedLoadNarrowing) || !DstVTy || !SrcVTy ||
1384+
if (!m_CGCtx->platform.enableBitcastedLoadNarrowing() || !DstVTy || !SrcVTy ||
13851385
DstVTy->getNumElements() != SrcVTy->getNumElements()) {
13861386
BC = nullptr;
13871387
} else {
@@ -1435,7 +1435,7 @@ Instruction *VectorPreProcess::simplifyLoadStore(Instruction *Inst) {
14351435
// as a float).
14361436
// TODO: remove WA when issue is resolved.
14371437
bool skipSimplifyBitcastedOneUse =
1438-
canSimplifyOneUse && BC && IGC_IS_FLAG_DISABLED(EnableBitcastedLoadNarrowingToScalar);
1438+
canSimplifyOneUse && BC && !m_CGCtx->platform.enableBitcastedLoadNarrowingToScalar();
14391439

14401440
auto simplifyLDVecToLDRaw = [&](bool calc_offset) {
14411441
auto EE_user = ConstEEIUses.front();

0 commit comments

Comments
 (0)