[llvm] [TableGen] Print a warning when a Processor contains duplicate Features / TuneFeatures (PR #137864)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 29 14:00:48 PDT 2025


================
@@ -357,8 +367,10 @@ unsigned SubtargetEmitter::cpuKeyValues(raw_ostream &OS,
   for (const Record *Processor : ProcessorList) {
     StringRef Name = Processor->getValueAsString("Name");
     ConstRecVec FeatureList = Processor->getValueAsListOfDefs("Features");
+    checkDuplicateCPUFeatures(Name, "Features", FeatureList);
----------------
mshockwave wrote:

> Can the same feature appear in both Features and TuneFeatures? If not, should we check that as well?

Good catch, right now we aggregate processor features and tune features together in MCSubtargetInfo, so I don't think it makes sense to have a feature appears in both sets. I have updated the patch to print a warning for that situation as well.

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


More information about the llvm-commits mailing list