[llvm] r216993 - Tablegen scheduling models don't reference empty itineraries as of r216919, so don't emit the unused itinerary variables

Pete Cooper peter_cooper at apple.com
Tue Sep 2 16:23:34 PDT 2014


Author: pete
Date: Tue Sep  2 18:23:34 2014
New Revision: 216993

URL: http://llvm.org/viewvc/llvm-project?rev=216993&view=rev
Log:
Tablegen scheduling models don't reference empty itineraries as of r216919, so don't emit the unused itinerary variables

Modified:
    llvm/trunk/utils/TableGen/SubtargetEmitter.cpp

Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=216993&r1=216992&r2=216993&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Tue Sep  2 18:23:34 2014
@@ -575,12 +575,13 @@ EmitItineraries(raw_ostream &OS,
     assert(ProcItinListsIter != ProcItinLists.end() && "bad iterator");
     std::vector<InstrItinerary> &ItinList = *ProcItinListsIter;
 
+    // Empty itineraries aren't referenced anywhere in the tablegen output
+    // so don't emit them.
+    if (ItinList.empty())
+      continue;
+
     OS << "\n";
     OS << "static const llvm::InstrItinerary ";
-    if (ItinList.empty()) {
-      OS << '*' << Name << " = nullptr;\n";
-      continue;
-    }
 
     // Begin processor itinerary table
     OS << Name << "[] = {\n";





More information about the llvm-commits mailing list