[llvm] [AMDGPU] Fix `HasFP32Denormals` check in FDIV32 lowering (PR #66212)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 07:12:33 PDT 2023


https://github.com/Pierre-vh created https://github.com/llvm/llvm-project/pull/66212:

Fixes SWDEV-403219

>From 0f23a32d0edec83ec33f88d9961c0a1aa54bc167 Mon Sep 17 00:00:00 2001
From: pvanhout <pierre.vanhoutryve at amd.com>
Date: Wed, 13 Sep 2023 15:47:17 +0200
Subject: [PATCH] [AMDGPU] Fix `HasFP32Denormals` check in FDIV32 lowering

Fixes SWDEV-403219
---
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 777fe76df1151cd..998904bf08820c0 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -9589,7 +9589,7 @@ SDValue SITargetLowering::LowerFDIV32(SDValue Op, SelectionDAG &DAG) const {
   const SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
   const DenormalMode DenormMode = Info->getMode().FP32Denormals;
 
-  const bool HasFP32Denormals = DenormMode == DenormalMode::getIEEE();
+  const bool HasFP32Denormals = DenormMode != DenormalMode::getPreserveSign();
 
   if (!HasFP32Denormals) {
     // Note we can't use the STRICT_FMA/STRICT_FMUL for the non-strict FDIV



More information about the llvm-commits mailing list