github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c --
clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/cl-x86-flags.c
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp
b/clang/lib/Driver/ToolChains/Clang.cpp
index add34c63d..c9e6963cb 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -8266,36 +8266,36 @@ void Clang::AddClangCLArgs(const ArgList &Args,
types::ID InputType,
<< "/kernel";
}
- if (Args.hasArg(options::OPT__SLASH_vlen_default)) {
- // Override /vlen= options.
- for (const Arg *A : Args.filtered(options::OPT__SLASH_vlen))
- A->claim();
- // Nothing to do for AVX512F/AVX512.
- } else if (const Arg *A = Args.getLastArg(options::OPT__SLASH_vlen)) {
- StringRef VLen = A->getValue();
- llvm::SmallSet<std::string, 4> Arch512 = {"AVX512F", "AVX512"};
- llvm::SmallSet<std::string, 4> Arch256 = {"AVX", "AVX2"};
-
- StringRef Arch = Args.getLastArgValue(options::OPT__SLASH_arch);
- if (Arch != "") {
- if (VLen == "=512") {
- if (Arch512.contains(Arch.str()))
- CmdArgs.push_back("-mprefer-vector-width=512");
- else
- D.Diag(diag::warn_drv_argument_not_allowed_with)
- << "/vlen=512" << std::string("/arch:").append(Arch);
- } else if (VLen == "=256") {
- if (Arch512.contains(Arch.str()))
- CmdArgs.push_back("-mprefer-vector-width=256");
- else if (!Arch256.contains(Arch.str()))
- D.Diag(diag::warn_drv_argument_not_allowed_with)
- << "/vlen=256" << std::string("/arch:").append(Arch);
- } else {
- D.Diag(diag::warn_drv_unknown_argument_clang_cl)
- << std::string("/vlen").append(VLen);
- }
- }
- }
+ if (Args.hasArg(options::OPT__SLASH_vlen_default)) {
+ // Override /vlen= options.
+ for (const Arg *A : Args.filtered(options::OPT__SLASH_vlen))
+ A->claim();
+ // Nothing to do for AVX512F/AVX512.
+ } else if (const Arg *A = Args.getLastArg(options::OPT__SLASH_vlen)) {
+ StringRef VLen = A->getValue();
+ llvm::SmallSet<std::string, 4> Arch512 = {"AVX512F", "AVX512"};
+ llvm::SmallSet<std::string, 4> Arch256 = {"AVX", "AVX2"};
+
+ StringRef Arch = Args.getLastArgValue(options::OPT__SLASH_arch);
+ if (Arch != "") {
+ if (VLen == "=512") {
+ if (Arch512.contains(Arch.str()))
+ CmdArgs.push_back("-mprefer-vector-width=512");
+ else
+ D.Diag(diag::warn_drv_argument_not_allowed_with)
+ << "/vlen=512" << std::string("/arch:").append(Arch);
+ } else if (VLen == "=256") {
+ if (Arch512.contains(Arch.str()))
+ CmdArgs.push_back("-mprefer-vector-width=256");
+ else if (!Arch256.contains(Arch.str()))
+ D.Diag(diag::warn_drv_argument_not_allowed_with)
+ << "/vlen=256" << std::string("/arch:").append(Arch);
+ } else {
+ D.Diag(diag::warn_drv_unknown_argument_clang_cl)
+ << std::string("/vlen").append(VLen);
+ }
+ }
+ }
Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg);
Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb);
``````````
</details>
https://github.com/llvm/llvm-project/pull/166375
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits