File tree Expand file tree Collapse file tree 6 files changed +6
-11
lines changed Expand file tree Collapse file tree 6 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,6 @@ namespace IGC
95
95
// / The driver implements single instance vertex dispatch feature
96
96
virtual bool SupportsSingleInstanceVertexDispatch () const { return false ; }
97
97
98
- // / We can safely ignore Nan
99
- virtual bool IgnoreNan () const { return false ; }
100
-
101
98
// Allow branch swapping for better Nan perf
102
99
virtual bool BranchSwapping () const { return false ; }
103
100
Original file line number Diff line number Diff line change @@ -286,9 +286,6 @@ bool GenIRLowering::runOnFunction(Function& F) {
286
286
if (FII == MDU->end_FunctionsInfo ())
287
287
return false ;
288
288
289
- CodeGenContextWrapper* pCtxWrapper = &getAnalysis<CodeGenContextWrapper>();
290
- CodeGenContext* ctx = pCtxWrapper->getCodeGenContext ();
291
-
292
289
auto &DL = F.getParent ()->getDataLayout ();
293
290
294
291
BuilderTy TheBuilder (F.getContext (), TargetFolder (DL));
@@ -397,7 +394,7 @@ bool GenIRLowering::runOnFunction(Function& F) {
397
394
break ;
398
395
case Instruction::Select:
399
396
// Enable the pattern match only when NaNs can be ignored.
400
- if (ctx-> m_DriverInfo . IgnoreNan () ||
397
+ if (modMD-> compOpt . NoNaNs ||
401
398
modMD->compOpt .FiniteMathOnly )
402
399
{
403
400
Changed |= combineSelectInst (cast<SelectInst>(Inst), BI);
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ namespace IGC
626
626
627
627
// TODO: move to use instruction flags
628
628
// to figure out if we need to preserve Nan
629
- bool preserveNan = !ctx.m_DriverInfo . IgnoreNan () ;
629
+ bool preserveNan = !ctx.getCompilerOption (). NoNaNs ;
630
630
631
631
// Legalizer does not handle constant expressions
632
632
mpm.add (new BreakConstantExpr ());
Original file line number Diff line number Diff line change @@ -1725,7 +1725,7 @@ void GenSpecificPattern::visitCmpInst(CmpInst& I)
1725
1725
else
1726
1726
{
1727
1727
CodeGenContext* pCtx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext ();
1728
- if (pCtx->m_DriverInfo . IgnoreNan () )
1728
+ if (pCtx->getCompilerOption (). NoNaNs )
1729
1729
{
1730
1730
if (I.getPredicate () == CmpInst::FCMP_ORD)
1731
1731
{
Original file line number Diff line number Diff line change @@ -1996,7 +1996,7 @@ void CustomUnsafeOptPass::visitFCmpInst(FCmpInst& FC)
1996
1996
}
1997
1997
if (FC.getPredicate () == CmpInst::FCMP_UNO)
1998
1998
{
1999
- if (m_ctx->m_DriverInfo . IgnoreNan () )
1999
+ if (m_ctx->getCompilerOption (). NoNaNs )
2000
2000
{
2001
2001
FC.replaceAllUsesWith (ConstantInt::getFalse (FC.getType ()));
2002
2002
FC.eraseFromParent ();
@@ -2006,7 +2006,7 @@ void CustomUnsafeOptPass::visitFCmpInst(FCmpInst& FC)
2006
2006
}
2007
2007
else if (FC.getPredicate () == CmpInst::FCMP_ORD)
2008
2008
{
2009
- if (m_ctx->m_DriverInfo . IgnoreNan () )
2009
+ if (m_ctx->getCompilerOption (). NoNaNs )
2010
2010
{
2011
2011
FC.replaceAllUsesWith (ConstantInt::getTrue (FC.getType ()));
2012
2012
FC.eraseFromParent ();
Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ namespace IGC
190
190
bool OptDisable = false ;
191
191
bool MadEnable = false ;
192
192
bool NoSignedZeros = false ;
193
+ bool NoNaNs = false ;
193
194
194
195
// default rounding modes
195
196
unsigned FloatRoundingMode = IGC::ROUND_TO_NEAREST_EVEN;
You can’t perform that action at this time.
0 commit comments