[PATCH] D155824: [LoongArch] Support -march=native and -mtune=

Lu Weining via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 19:28:20 PDT 2023


SixWeining marked an inline comment as done.
SixWeining added inline comments.


================
Comment at: clang/lib/Basic/Targets/LoongArch.cpp:203
+  StringRef ArchName = getCPU();
+  Builder.defineMacro("__loongarch_arch", Twine("\"") + ArchName + Twine("\""));
+
----------------
MaskRay wrote:
> Use the `Twine(char)` constructor.
Thanks.


================
Comment at: clang/test/Driver/loongarch-mtune-error.c:1
+// RUN: not %clang --target=loongarch64 -mtune=invalidcpu -fsyntax-only %s 2>&1 | FileCheck %s
+// RUN: not %clang --target=loongarch64 -mtune=generic -fsyntax-only %s 2>&1 | FileCheck %s
----------------
MaskRay wrote:
> Use `-###` to test the driver. Consider merging this test into the `loongarch-mtune.c`. 
Done. Thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155824



More information about the cfe-commits mailing list