https://github.com/Syllo updated 
https://github.com/llvm/llvm-project/pull/230212

>From 17691e4cb74f6bed92ec2d9910065823cbf7f524 Mon Sep 17 00:00:00 2001
From: Maxime Schmitt <[email protected]>
Date: Tue, 6 Oct 2026 07:28:31 -0400
Subject: [PATCH] [Hexagon] Stop forwarding unsupported fast-math option for
 lossy QFloat

-fast-math=true is a Qualcomm-downstream-only option and does not
exist upstream. Do not forward it from the driver.
---
 clang/lib/Driver/ToolChains/Clang.cpp       | 1 -
 clang/test/Driver/hexagon-hvx-ieee-qfloat.c | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 2325e7cc552ef9..6c1dcfdf9b2d67 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2317,7 +2317,6 @@ static void addQFloatLossyFastMathArgs(ArgStringList 
&CmdArgs) {
   CmdArgs.push_back("-ffast-math");
   CmdArgs.push_back("-ffinite-math-only");
   CmdArgs.push_back("-D__FAST_MATH__");
-  pushBackLLVMArg(CmdArgs, "-fast-math=true");
 }
 
 static void addQFloatBackendArg(const Driver &D, const ArgList &Args,
diff --git a/clang/test/Driver/hexagon-hvx-ieee-qfloat.c 
b/clang/test/Driver/hexagon-hvx-ieee-qfloat.c
index ee8dc9de257514..d0c5f866a51e10 100644
--- a/clang/test/Driver/hexagon-hvx-ieee-qfloat.c
+++ b/clang/test/Driver/hexagon-hvx-ieee-qfloat.c
@@ -23,3 +23,12 @@
 // CHECK-FEATURE-NOT: "-target-feature" "+hvx-qfloat"
 // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv75 -mhvx \
 // RUN:   -mhvx-ieee-fp 2>&1 | FileCheck -check-prefix=CHECK-FEATURE %s
+
+// Lossy QFloat sets the target mode and frontend fast-math flags, without
+// forwarding the removed LLVM -fast-math option.
+// CHECK-LOSSY: "-mllvm" "-hexagon-qfloat-mode=lossy"
+// CHECK-LOSSY-NOT: "-fast-math=true"
+// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv79 -mhvx \
+// RUN:   -mhvx-qfloat=lossy 2>&1 | FileCheck -check-prefix=CHECK-LOSSY %s
+// RUN: %clang -c %s -target hexagon-unknown-elf -mv79 -mhvx \
+// RUN:   -mhvx-qfloat=lossy -o %t.o

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

Reply via email to