[PATCH] D54214: [RISCV] Set triple based on -march flag

Zixuan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 19:35:04 PDT 2022


zixuan-wu added a comment.
Herald added subscribers: sunshaoce, pcwang-thead, eopXD, VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, luismarques, MaskRay, arichardson.
Herald added a project: All.

In D54214#1737255 <https://reviews.llvm.org/D54214#1737255>, @simoncook wrote:

> Rebase.
>
> @lenary Following the discussion regarding D69383 <https://reviews.llvm.org/D69383>, I think it's best for now to keep the logic just keeping `-march` directly, rather than using `getRISCVArch`. I think in the case of `-target risc32-..... -mabi=lp64` I think it would confuse users if the tools suddenly changed to doing an rv64 compile. If we disable that, all that function would provide me is the same StringRef I'm already evaluating. I think adding any extra flag to indicate whether a rv32<->rv64 switch is acceptable would just make the code unnecessarily more messy. I think in the future if `getRISCVArch` evaluates more flags, then it might make sense to reconsider this.

I think the case of `-target risc32-..... -mabi=lp64` is acceptable since the -target is less usable than -march/-mabi/-mcpu and is almost invisible to users.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D54214



More information about the cfe-commits mailing list