[llvm] [llvm][MC] Add public getAllProcessorFeatures() (PR #66582)

Balint Cristian via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 16 11:55:54 PDT 2023


cbalint13 wrote:

> We need justification to have this API, ideally tested by an in-tree target, otherwise this is prone to be removed by another contributor as an unused function.

@MaskRay ,

Then, 

For begining, how about using this direct thing inside [getFeaturesForCPU()](https://github.com/search?q=repo%3Allvm%2Fllvm-project%20getFeaturesForCPU&type=code)  ?

Currently it use separately info from [llvm/TargetParser/X86TargetParser.def](https://github.com/llvm/llvm-project/blob/5bdd5d064d5171b2d5ff6268528cfffd2f86b8ea/llvm/include/llvm/TargetParser/X86TargetParser.def), apart (not in sync) from the tablegen [x86.td](https://github.com/llvm/llvm-project/blob/5bdd5d064d5171b2d5ff6268528cfffd2f86b8ea/llvm/lib/Target/X86/X86.td)

---

There is a way querying via ```MCsubtargetInfo``` all legit CPUs of any target and all it's related features (with this PR) directly from the tablegen information. This would de-duplicate the effort things like ```X86TargetParser.def``` and same story goes for ```AArch64TargetParser.def```. I hope this statement here is not mistaken by me.

What do you think ?

https://github.com/llvm/llvm-project/pull/66582


More information about the llvm-commits mailing list