[PATCH] D121183: [RISCV] Generate correct ELF EFlags when .ll file has target-abi attribute

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 18:31:25 PST 2022


StephenFan added inline comments.


================
Comment at: llvm/test/CodeGen/RISCV/module-target-abi2.ll:16
 ; DEFAULT-NEXT: fcvt.s.w fa0, a0
 ; DEFAULT-NEXT: ret
 ; RV32IF-ILP32F: # %bb.0:
----------------
khchen wrote:
> The elf attribute becomes correct, but I think the assembly is still incorrect?
> LLVM can not read the -target-abi from IR and overwrite the MCTargetOptions.ABIName,
> It's why https://reviews.llvm.org/D102582 would like to report an error if users give the mismatch -target-abi comparing to IR's.
> 
Do you mind giving a test case that can reflect the assembly is incorrect ? 
This patch wants to generate the correct eflags if the target-abi information is in IR instead of being specified by command line.
Indeed, LLVM can not read the -target-abi IR from and overwrite the MCTargetOptions.ABIName, So I put the ABI info in `RISCVTargetStreamer`, and set it before the end of `AsmPrinter`. Because I think at the end of `AsmPrinter`, the ABI value should have been  determined. And `mips` seems to be too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121183



More information about the llvm-commits mailing list