[llvm] 90f60a6 - NVPTX: Cleanup check for denormal mode
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 12:56:28 PST 2022
Author: Matt Arsenault
Date: 2022-12-07T15:56:21-05:00
New Revision: 90f60a6a737b397c49c56371f628e4b6440c00fd
URL: https://github.com/llvm/llvm-project/commit/90f60a6a737b397c49c56371f628e4b6440c00fd
DIFF: https://github.com/llvm/llvm-project/commit/90f60a6a737b397c49c56371f628e4b6440c00fd.diff
LOG: NVPTX: Cleanup check for denormal mode
Go through the common query and be explicit about the supported flush
type.
Added:
Modified:
llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
index 7dac28f725a5a..f39934ae13e80 100644
--- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
@@ -369,12 +369,10 @@ static Instruction *simplifyNvvmIntrinsic(IntrinsicInst *II, InstCombiner &IC) {
// 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;
More information about the llvm-commits
mailing list