[clang] [clang][driver] Improve warning message for complex range overrides (PR #154899)

2025-08-22 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: I'm not a native English speaker, so if you have any suggestions for improving the warning message, I'd really appreciate it. https://github.com/llvm/llvm-project/pull/154899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][driver] Improve warning message for complex range overrides (PR #154899)

2025-08-21 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 created https://github.com/llvm/llvm-project/pull/154899 This patch improves the warnings to show which user options override the complex range. When a complex range is overridden, explicitly display both the option name and the implied complex range value for

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-08-14 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: Thank you for agreeing! I'll post a patch to fix only the overriding warnings around next week. https://github.com/llvm/llvm-project/pull/149028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-29 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: The implementation would become complex and it would be difficult to accurately track GCC, so I will stop trying to output warnings about incompatibility with GCC. However, there is a problem that the warning message when a complex range is overridden displays options that

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-25 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: > To be honest, I'm not entirely convinced of the value of having these > warnings in the first place. RenderFloatingPointOptions is already pretty > gnarly and hard to follow, and trying to capture what gcc would have done > based on its priority system so we can warn if

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-25 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: > I'm not sure the combined warning is necessary. I think just stating that the > clang option overrides the GCC option is sufficient since there is no sense > in which clang-specific options can be incompatible with GCC if GCC doesn't > implement the option. In this patc

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-24 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: @andykaylor Could you please comment on Clang's complex number warnings? https://github.com/llvm/llvm-project/pull/149028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-18 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: Thank you for the feedback! > IIRC GCC is not even consistent with the combination of these flags. In GCC 14, as I previously mentioned [here](https://discourse.llvm.org/t/the-priority-of-fno-fast-math-regarding-complex-number-calculations/84679/8), `-f[no-]cx-fortran-ru

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-16 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 updated https://github.com/llvm/llvm-project/pull/149028 >From 033d5f13583bd27baff51f9cf3f0b9e68ca0f58a Mon Sep 17 00:00:00 2001 From: s-watanabe314 Date: Tue, 8 Jul 2025 15:50:51 +0900 Subject: [PATCH] [clang][driver] Improve warning message for complex range

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-16 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: @andykaylor @AaronBallman What do you think about making the warnings about complex range behave as described above? Any feedback would be greatly appreciated. https://github.com/llvm/llvm-project/pull/149028 ___ cfe-commits mail

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-16 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: This patch is a draft. I created it because I thought it would be easier to discuss the behavior of overriding and GCC incompatibility warnings related to complex range with concrete examples of implementation and tests. In this implementation example, each warning will be

[clang] [clang][driver] Improve warning message for complex range overrides and GCC incompatibility (PR #149028)

2025-07-16 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 created https://github.com/llvm/llvm-project/pull/149028 This patch improves the warnings to show which user options overrides the complex range. It also warns when Clang's last-flag-wins rule causes incompatibility with GCC. When both warnings are necessary, a

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-07 Thread Shunsuke Watanabe via cfe-commits
@@ -3409,3 +3409,30 @@ StringRef tools::parseMRecipOption(clang::DiagnosticsEngine &Diags, return Out; } + +std::string tools::ComplexRangeKindToStr(LangOptions::ComplexRangeKind Range) { s-watanabe314 wrote: Thank you for the review. I have corrected the

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-07 Thread Shunsuke Watanabe via cfe-commits
@@ -1023,12 +1023,12 @@ defm offload_uniform_block : BoolFOption<"offload-uniform-block", BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>; def fcomplex_arithmetic_EQ : Joined<["-"], "fcomp

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-04 Thread Shunsuke Watanabe via cfe-commits
@@ -9,6 +9,7 @@ #ifndef FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H #define FORTRAN_OPTIMIZER_CODEGEN_CODEGEN_H +#include "flang/Frontend/CodeGenOptions.h" s-watanabe314 wrote: Thank you for the reviews! > Not requesting to do that here, but I feel the CodeGenOptions

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-04 Thread Shunsuke Watanabe via cfe-commits
@@ -192,6 +192,31 @@ class CodeGenOptions : public CodeGenOptionsBase { return getProfileUse() == llvm::driver::ProfileCSIRInstr; } + /// Controls the various implementations for complex division. s-watanabe314 wrote: Thank you for providing the exampl

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-04 Thread Shunsuke Watanabe via cfe-commits
@@ -595,6 +595,30 @@ void Flang::addOffloadOptions(Compilation &C, const InputInfoList &Inputs, addOpenMPHostOffloadingArgs(C, JA, Args, CmdArgs); } +static std::string ComplexRangeKindToStr(LangOptions::ComplexRangeKind Range) { + switch (Range) { + case LangOptions::Com

[clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

2025-07-04 Thread Shunsuke Watanabe via cfe-commits
@@ -1023,12 +1023,12 @@ defm offload_uniform_block : BoolFOption<"offload-uniform-block", BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>; def fcomplex_arithmetic_EQ : Joined<["-"], "fcomp

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-07-04 Thread Shunsuke Watanabe via cfe-commits
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning< "math errno enabled by '%0' after it was implicitly disabled by '%1'," " this may limit the utilization of the vector library">, InGroup; +def warn_drv_gcc_incompatible_complex_range_override: Warn

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-06-27 Thread Shunsuke Watanabe via cfe-commits
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning< "math errno enabled by '%0' after it was implicitly disabled by '%1'," " this may limit the utilization of the vector library">, InGroup; +def warn_drv_gcc_incompatible_complex_range_override: Warn

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-06-25 Thread Shunsuke Watanabe via cfe-commits
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning< "math errno enabled by '%0' after it was implicitly disabled by '%1'," " this may limit the utilization of the vector library">, InGroup; +def warn_drv_gcc_incompatible_complex_range_override: Warn

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-06-19 Thread Shunsuke Watanabe via cfe-commits
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning< "math errno enabled by '%0' after it was implicitly disabled by '%1'," " this may limit the utilization of the vector library">, InGroup; +def warn_drv_gcc_incompatible_complex_range_override: Warn

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-06-17 Thread Shunsuke Watanabe via cfe-commits
@@ -520,6 +520,9 @@ def warn_drv_math_errno_enabled_after_veclib: Warning< "math errno enabled by '%0' after it was implicitly disabled by '%1'," " this may limit the utilization of the vector library">, InGroup; +def warn_drv_gcc_incompatible_complex_range_override: Warn

[clang] [Clang][Driver] Warn on complex number range incompatibility with GCC (PR #144468)

2025-06-16 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 created https://github.com/llvm/llvm-project/pull/144468 This patch adds a warning for incompatible complex number behavior compared to GCC due to Clang's "last-flag-wins" rule. Incompatibilities with GCC occur in the following seven cases. Clang uses the last

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

2025-06-11 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 closed https://github.com/llvm/llvm-project/pull/132680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

2025-06-11 Thread Shunsuke Watanabe via cfe-commits
https://github.com/s-watanabe314 updated https://github.com/llvm/llvm-project/pull/132680 >From 9265cb96cc3129fada722d7195a1cf04e985ba33 Mon Sep 17 00:00:00 2001 From: s-watanabe314 Date: Fri, 14 Mar 2025 11:56:32 +0900 Subject: [PATCH 1/4] [Clang][Driver] Override complex number calculation m

[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)

2025-06-10 Thread Shunsuke Watanabe via cfe-commits
s-watanabe314 wrote: Thank you for the review! I will also merge a minor change to initialize `ComplexRangeStr` and `GccRangeComplexOption` together. https://github.com/llvm/llvm-project/pull/132680 ___ cfe-commits mailing list cfe-commits@lists.llvm.