https://github.com/wenju-he created 
https://github.com/llvm/llvm-project/pull/183262

This PR is extracted from #157633.
`-fdenormal-fp-math=dynamic` is required to defer denormal handling and should 
be used for libclc library compilation.

Additionally, if the default ieee value is incompatible with the user code's 
denormal-fp-math setting, this mismatch prevents libclc functions from being 
inlined.

>From 2f0acbf0bf85416ef2fc89a0268be7b8021b84ae Mon Sep 17 00:00:00 2001
From: Wenju He <[email protected]>
Date: Wed, 25 Feb 2026 09:53:41 +0100
Subject: [PATCH] [libclc] Compile with -fdenormal-fp-math=dynamic

This PR is extracted from #157633.
`-fdenormal-fp-math=dynamic` is required to defer denormal handling and
should be used for libclc library compilation.

Additionally, if the default ieee value is incompatible with the user
code's denormal-fp-math setting, this mismatch prevents libclc functions
from being inlined.
---
 libclc/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index f01c3cc98a739..3252e2625debc 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -369,6 +369,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
       -Werror=undef
       -fdiscard-value-names
       -ffp-contract=fast-honor-pragmas
+      -fdenormal-fp-math=dynamic
     )
 
     if( NOT "${cpu}" STREQUAL "" )

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to