[llvm] r339528 - [globalisel] Remove dead code from GlobalISelEmitter

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 14:49:43 PDT 2018


Author: dsanders
Date: Sun Aug 12 14:49:42 2018
New Revision: 339528

URL: http://llvm.org/viewvc/llvm-project?rev=339528&view=rev
Log:
[globalisel] Remove dead code from GlobalISelEmitter

Summary: Found by GCC's -Wunused-function.

Patch by Kim Gräsman

Reviewers: ab, dsanders, llvm-commits

Reviewed By: dsanders

Subscribers: rovka, kristof.beyls

Differential Revision: https://reviews.llvm.org/D50611

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

Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=339528&r1=339527&r2=339528&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Sun Aug 12 14:49:42 2018
@@ -2984,9 +2984,6 @@ private:
   void gatherOpcodeValues();
   void gatherTypeIDValues();
   void gatherNodeEquivs();
-  // Instruction predicate code that will be emitted in generated functions.
-  SmallVector<std::string, 2> InstructionPredicateCodes;
-  unsigned getOrCreateInstructionPredicateFnId(StringRef Code);
 
   Record *findNodeEquiv(Record *N) const;
   const CodeGenInstruction *getEquivNode(Record &Equiv,
@@ -3085,20 +3082,6 @@ void GlobalISelEmitter::gatherOpcodeValu
 void GlobalISelEmitter::gatherTypeIDValues() {
   LLTOperandMatcher::initTypeIDValuesMap();
 }
-unsigned GlobalISelEmitter::getOrCreateInstructionPredicateFnId(StringRef Code) {
-  // There's not very many predicates that need to be here at the moment so we
-  // just maintain a simple set-like vector. If it grows then we'll need to do
-  // something more efficient.
-  const auto &I = std::find(InstructionPredicateCodes.begin(),
-                            InstructionPredicateCodes.end(),
-                            Code);
-  if (I == InstructionPredicateCodes.end()) {
-    unsigned ID = InstructionPredicateCodes.size();
-    InstructionPredicateCodes.push_back(Code);
-    return ID;
-  }
-  return std::distance(InstructionPredicateCodes.begin(), I);
-}
 
 void GlobalISelEmitter::gatherNodeEquivs() {
   assert(NodeEquivs.empty());




More information about the llvm-commits mailing list