This adds support for ".attribute arch" for all extensions that are
currently supported by the compiler.
Depends on D94403.
simoncook on Jan 18 2021, 12:32 PM.Authored by
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.
I think maybe we could extract the arch parser from driver 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.
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.
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.