Skip to content

Commit f574d45

Browse files
krystian-andrzejewskisys_zuul
authored andcommitted
IGC constant folding works only on internal intrinsics
ConstantFolderIGC is introduced to assure availibility of constant folding functionality for IGC clients. The constant folder give a hand for the instructions that are not constant folded by llvm passes or its folder. Change-Id: I6558ac720b8ed729d4c580f3c55618404a7d8d49
1 parent 5ebf9e5 commit f574d45

File tree

8 files changed

+289
-231
lines changed

8 files changed

+289
-231
lines changed

IGC/AdaptorOCL/DriverInfoOCL.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ namespace TC
3838

3939
bool SupportsIEEEMinMax() const override { return true; }
4040

41-
bool SupportsPreciseMath() const override { return true; }
42-
4341
bool NeedCheckContractionAllowed() const override { return true; }
4442

4543
bool NeedI64BitDivRem() const override { return true; }

IGC/Compiler/CISACodeGen/DriverInfo.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ namespace IGC
115115
/// API supports IEEE min/max
116116
virtual bool SupportsIEEEMinMax() const { return false; }
117117

118-
/// Supports precise math
119-
virtual bool SupportsPreciseMath() const { return false; }
120-
121118
virtual bool NeedCountSROA() const { return false; }
122119

123120
/// Can we always contract mul and add

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ void OptimizeIR(CodeGenContext* const pContext)
14111411
}
14121412

14131413
mpm.add(new BreakConstantExpr());
1414-
mpm.add(new IGCConstProp(!pContext->m_DriverInfo.SupportsPreciseMath()));
1414+
mpm.add(new IGCConstProp());
14151415

14161416
mpm.add(new CustomSafeOptPass());
14171417
if (!pContext->m_DriverInfo.WADisableCustomPass())
@@ -1552,8 +1552,7 @@ void OptimizeIR(CodeGenContext* const pContext)
15521552
mpm.add(llvm::createAggressiveDCEPass());
15531553

15541554
mpm.add(new BreakConstantExpr());
1555-
mpm.add(new IGCConstProp(!pContext->m_DriverInfo.SupportsPreciseMath(),
1556-
IGC_IS_FLAG_ENABLED(EnableSimplifyGEP)));
1555+
mpm.add(new IGCConstProp(IGC_IS_FLAG_ENABLED(EnableSimplifyGEP)));
15571556

15581557
if (IGC_IS_FLAG_DISABLED(DisableImmConstantOpt))
15591558
{

0 commit comments

Comments
 (0)