[PATCH] D155201: [Clang][AArch64] Introduce CLANG_AARCH64_DEFAULT_CPU

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 08:56:44 PDT 2023


SjoerdMeijer added a comment.

In D155201#4497960 <https://reviews.llvm.org/D155201#4497960>, @madhur13490 wrote:

> Other approach worth looking at is to push args in Clang.cpp. We can look at `AddAArch64TargetArgs()` and pass default CPU if -mcpu or mtune is not provided.

yes, but I think I prefer this approach if I am able find a solution for the test cases. This approach defines a variable, which we can use to define a "substitution" in the lit configuration file (https://llvm.org/docs/TestingGuide.html#substitutions).

In lit.cfg.py, I am looking to add something along the lines of:

  config.substitutions.append(("%AARCH64_DEFAULT_CPU", @CLANG_AARCH64_DEFAULT_CPU@))

And then in the test files we can check for:

  "-target-cpu" %(AARCH64_DEFAULT_CPU)

I don't have it working yet, but am working on it.
I think this is the more elegant solution, which pushing an -mcpu value doesn't provide, I think.


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

https://reviews.llvm.org/D155201



More information about the llvm-commits mailing list