// 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;
+ // FIXME: Broken for f64
+ 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;