This adds support for ".attribute arch" for all extensions that are
currently supported by the compiler.
Depends on D94403.
Paths
| Differential D94931
[RISCV] Add attribute support for all supported extensions ClosedPublic Authored by simoncook on Jan 18 2021, 12:32 PM.
Details Summary This adds support for ".attribute arch" for all extensions that are Depends on D94403.
Diff Detail
Event TimelineHerald added subscribers: frasercrmck, NickHung, jdoerfert and 23 others. · View Herald TranscriptJan 18 2021, 12:32 PM
Comment Actions Do you consider to modify ELFObjectFileBase::getRISCVFeatures() in llvm/lib/Object/ELFObjectFile.cpp? Comment Actions
Thanks for pointing that bit out. I was comparing against your previous work to check I'd covered everything, but missed that bit. I'll add an update to that file in this patch shortly. Comment Actions Add support to llvm/lib/Object/ELFObjectFile.cpp Extend disassembly test to check above change works via llvm-objdump Comment Actions I think maybe we could extract the arch parser from driver[1] to llvm/lib/Support, so that we could just maintain one parser for driver and assembler, and there is also other potential user for that, like the C front-end for the target attribute, e.g. __attribute__ ((target ("arch=rv64gcv"))), and the linker can re-use that to read/merge/write the attribute too. [1] https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp#L171 Comment Actions
I was thinking about this too and was going to discuss it on Thursday's call. At the very least, even if we don't move the parser, the number of places that extension version numbers are add and used throughout the tools seems to call for it being centralised somewhere. Comment Actions
Let's discuss that on the call :) The march parser rule is become very complicated now, so I think centralized that definitely is good idea.
Comment Actions Note from the last sync up call, it's ok to landing that once review is done without refactor, refactor could be done separately after LLVM 12 release, that's won't be a blocker issue for this patch. Comment Actions
This revision is now accepted and ready to land.Jan 24 2021, 7:11 PM This revision was landed with ongoing or failed builds.Jan 25 2021, 12:59 AM Closed by commit rGa7c1239f3749: [RISCV] Add attribute support for all supported extensions (authored by simoncook). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 318870 llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
llvm/test/CodeGen/RISCV/attributes.ll
llvm/test/MC/RISCV/attribute-arch.s
|
clang-tidy: warning: invalid case style for parameter 'c' [readability-identifier-naming]
not useful