[llvm-dev] getCacheSize() implementation (retrieving subtarget id)

Jonas Paulsson via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 17 07:48:06 PDT 2017


Hi,

While trying to implement the SystemZTTI::getCacheSize() method, it 
became clear that a simple way of retrieving the machine ID is somehow 
missing.

It seems that the Subtarget should set a variable during initialization 
perhaps by looking at the CPU string.

I would like to hear any opinion on how this would actually be best 
implemented.

* Comparing the CPU string seems to duplicate SystemZProcessors.td in 
the sense that it would ideally be sufficient to only specify the CPU 
string once.

* Extend ProcessorModel with a "processor model ID" that the Subtarget 
could later retrieve?

* Or instead extend MCSchedModel with the ID, or even store the cache 
size / assosiativity in MCSchedModel?

/ Jonas





More information about the llvm-dev mailing list