Index: llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp +++ llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp @@ -369,12 +369,9 @@ // intrinsic, we don't have to look up any module metadata, as // FtzRequirementTy will be FTZ_Any.) if (Action.FtzRequirement != FTZ_Any) { - const char *AttrName = - Action.IsHalfTy ? "denormal-fp-math" : "denormal-fp-math-f32"; - StringRef Attr = - II->getFunction()->getFnAttribute(AttrName).getValueAsString(); - DenormalMode Mode = parseDenormalFPAttribute(Attr); - bool FtzEnabled = Mode.Output != DenormalMode::IEEE; + DenormalMode Mode = II->getFunction()->getDenormalMode( + Action.IsHalfTy ? APFloat::IEEEhalf() : APFloat::IEEEsingle()); + bool FtzEnabled = Mode.Output == DenormalMode::PreserveSign; if (FtzEnabled != (Action.FtzRequirement == FTZ_MustBeOn)) return nullptr;