Skip to content

Commit 55e74dc

Browse files
gkluczekigcbot
authored andcommitted
GEPLowering improvement
GEPLowering for large constant addresses.
1 parent 204f6f0 commit 55e74dc

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

IGC/Compiler/CISACodeGen/GenIRLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ bool GEPLowering::lowerGetElementPtrInst(GetElementPtrInst* GEP) const
604604
else if (GEP->getAddressSpace() == ADDRESS_SPACE_CONSTANT || !modMD->compOpt.GreaterThan2GBBufferRequired)
605605
{
606606
canReduceNegativeOffset = true;
607-
pointerMathSizeInBits = 32;
607+
pointerMathSizeInBits = m_ctx->platform.hasLargeMaxConstantBufferSize() ? 64 : 32;
608608
reducePointerArith = true;
609609
}
610610
}

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,12 @@ bool has16OWSLMBlockRW() const
597597
return IGC_IS_FLAG_ENABLED(Enable16OWSLMBlockRW) && isProductChildOf(IGFX_XE_HP_SDV);
598598
}
599599

600+
bool hasLargeMaxConstantBufferSize() const
601+
{
602+
return IGC_IS_FLAG_DISABLED(Force32bitConstantGEPLowering) &&
603+
m_platformInfo.eProductFamily == IGFX_PVC;
604+
}
605+
600606
bool supportInlineData() const
601607
{
602608
return isProductChildOf(IGFX_XE_HP_SDV);

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ DECLARE_IGC_REGKEY(bool, AvoidDstSrcGRFOverlap, false, "avoid GRF
114114
DECLARE_IGC_REGKEY(bool, AvoidSrc1Src2Overlap, false, "avoid src1 and src2 GRF overlap to avoid the conflict without read suppression ", false)
115115
DECLARE_IGC_REGKEY(bool, UseLinearScanRA, false, "use Linear Scan as default register allocation algorithm ", false)
116116
DECLARE_IGC_REGKEY(bool, DisableWriteCombine, false, "Disable write combine. PVC+ only", false)
117+
DECLARE_IGC_REGKEY(bool, Force32bitConstantGEPLowering, false, "Go back to old version of GEP lowering for constant address space. PVC only", false)
117118

118119
DECLARE_IGC_GROUP("IGC Optimization")
119120
DECLARE_IGC_REGKEY(bool, AllowMem2Reg, false, "Setting this to true makes IGC run mem2reg even when optimizations are disabled", true)

0 commit comments

Comments
 (0)