llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.82k stars 10.99k forks source link

Flang driver compiler options request #89888

Open jeffhammond opened 2 months ago

jeffhammond commented 2 months ago

The Flang and Clang drivers are separate but many Clang flags make sense for Flang, because they are not language specific. Here is a list of flags that Flang should support.

As these are documented on https://clang.llvm.org/docs/ClangCommandLineReference.html, I will only list the option, not what it does.

currently known to be blocking, e.g. in Spack and CMake use cases

not known to be blockers but things I use regularly

code generation flags that have known utility

llvmbot commented 2 months ago

@llvm/issue-subscribers-flang-driver

Author: Jeff Hammond (jeffhammond)

The Flang and Clang drivers are separate but many Clang flags make sense for Flang, because they are not language specific. Here is a list of flags that Flang should support. As these are documented on https://clang.llvm.org/docs/ClangCommandLineReference.html, I will only list the option, not what it does. # currently known to be blocking, e.g. in Spack and CMake use cases - [ ] -w, --no-warnings - [ ] -mtune, -march, -mcpu - [ ] -Qunused-arguments # not known to be blockers but things I use regularly - [ ] -Wl and -Xlinker - [ ] -framework (MacOS-specific AFAIK) - [ ] -time - [ ] -static-openmp # generally useful in LLVM projects - [ ] -mllvm - [ ] -mmlir # code generation flags that have known utility - [ ] -mno-gather - [ ] -mno-scatter - [ ] -mrecip
banach-space commented 2 months ago

Thanks for creating this meta-ticket, that's much appreciated! While I won't have the bandwidth to implement this, I amavailable to review relevant PRs.

AlexisPerry commented 2 months ago

I'm working on mtune already, so I'll be sure to let you know here when I have the patch up for it.

AlexisPerry commented 2 months ago

Initial patch for -w support: https://github.com/llvm/llvm-project/pull/90420

h-vetinari commented 1 month ago

I wasn't aware of this issue when I opened https://github.com/llvm/llvm-project/issues/92459 for --visibility=, which is IMO quite important.

Other things I needed to patch out of default meson behaviour to get somewhere (i.e., flang 18 does not support these yet):

AlexisPerry commented 1 week ago

PR for basic mtune support: https://github.com/llvm/llvm-project/pull/95043