[PATCH] D58937: [Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 16:48:23 PST 2019


craig.topper created this revision.
craig.topper added reviewers: dblaikie, echristo, andreadb.
Herald added a subscriber: jdoerfert.

The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.


https://reviews.llvm.org/D58937

Files:
  include/llvm/MC/MCSubtargetInfo.h
  include/llvm/MC/SubtargetFeature.h
  lib/MC/MCSubtargetInfo.cpp
  lib/MC/SubtargetFeature.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58937.189233.patch
Type: text/x-patch
Size: 20683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190305/3086193b/attachment.bin>


More information about the llvm-commits mailing list