[PATCH] D87456: AMDGPU/GlobalISel Check target options before isKnownNeverSNaN
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 08:16:11 PDT 2020
arsenm added a comment.
Probably should add a dedicated test for this
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:2658
const TargetMachine &TM = MF->getTarget();
+ TM.resetTargetOptions(F);
SL = std::make_unique<GISelSwitchLowering>(this, FuncInfo);
----------------
Should copy the comment from the DAG
// Reset the target options before resetting the optimization
// level below.
// FIXME: This is a horrible hack and should be processed via
// codegen looking at the optimization level explicitly when
// it wants to look at it.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:5420
// omni-purpose G_FCANONICALIZE.
- if (!isKnownNeverSNaN(Src0, MRI))
- Src0 = MIRBuilder.buildFCanonicalize(Ty, Src0, MI.getFlags()).getReg(0);
+ if (!MI.getMF()->getTarget().Options.NoNaNsFPMath) {
+ if (!isKnownNeverSNaN(Src0, MRI))
----------------
I think checking these fields should be buried inside isKnownNeverSNaN
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87456/new/
https://reviews.llvm.org/D87456
More information about the llvm-commits
mailing list