[PATCH] D109587: [RISCV][WIP] Generate target attribute in attribute section of object file when assemble .s file

Zixuan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 00:16:19 PDT 2021


zixuan-wu added a comment.

In D109587#2998978 <https://reviews.llvm.org/D109587#2998978>, @kito-cheng wrote:

> GNU toolchain is always emit arch attribute even user didn't write it in assembly file, and it will implied the info from the `-march` option or default arch setting, it's what you want to do in LLVM part IIUC.
>
> But this implementation has some issue:
>
> - Inline asm will emit `.attribute 5,` (`.attribute Tag_RISCV_arch`) again, that result the output will reject by the GNU assembler since `.attribute Tag_RISCV_arch` required to be appear before any instruction.
> - NO new testcase added to demonstrate what you want to do, I would suggest you should add one, assemble a .s file to .o and then dump the attribute to make sure `.attribute Tag_RISCV_arch` has emitted properly.
>
> So I think the goal of this patch is right way, but the implementation need some tweaks, especially the code gen change for inline asm.

Yes, that's what I want to do.
Which place or file is appropriate to add such testcase?


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

https://reviews.llvm.org/D109587



More information about the llvm-commits mailing list