[PATCH] D136930: [RISCV] Support -mcpu/mtune=native

Wang Pengcheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 30 20:15:29 PDT 2022


pcwang-thead added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:2190
     CmdArgs.push_back("-tune-cpu");
-    CmdArgs.push_back(A->getValue());
+    if (strcmp(A->getValue(), "native") == 0)
+      CmdArgs.push_back(Args.MakeArgString(llvm::sys::getHostCPUName()));
----------------
craig.topper wrote:
> Why can't we use A->getValue() == "native" here?
Because newly-changed support of other targets (like PowerPC) are in this form, so I think this may benefit from simplification?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136930/new/

https://reviews.llvm.org/D136930



More information about the cfe-commits mailing list