[PATCH] D121073: [RISCV] Remove RISCVFeatures::validate function

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 21:36:40 PST 2022


craig.topper added a comment.

In D121073#3366178 <https://reviews.llvm.org/D121073#3366178>, @StephenFan wrote:

> [RISCV] Generate correct ELF EFlags when .ll file has target-abi attribute
>
> In the past, when construct `RISCVAsmBackend`, `MCTargetOptions.ABIName` would be passed and stored in `RISCVAsmBackend`.
> But `MCTargetOptions.ABIName` can only be specified by `-target-abi xxx` in command line, if the .ll file has `target-abi` attribute, the codegen module will ignore it. And the generated object file would have incorrect EFlags value.
>
> https://github.com/llvm/llvm-project/issues/50591 also caused by this problem.
>
> This patch override the `AsmPrinter::emitFunctionEntryLabel` function and use it to set the target abi value that get from .ll file's `target-abi` attribute. And storing the target-abi in `RISCVTargetStreamer` instead of `RISCVAsmBackend`.

Was this supposed to be a new review?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121073



More information about the llvm-commits mailing list