[llvm-commits] [llvm] r133964 - in /llvm/trunk: include/llvm/Target/TargetInstrDesc.h utils/TableGen/InstrInfoEmitter.cpp utils/TableGen/InstrInfoEmitter.h

Evan Cheng evan.cheng at apple.com
Mon Jun 27 16:47:21 PDT 2011


Author: evancheng
Date: Mon Jun 27 18:47:21 2011
New Revision: 133964

URL: http://llvm.org/viewvc/llvm-project?rev=133964&view=rev
Log:
Remove RCBarriers from TargetInstrDesc.

Modified:
    llvm/trunk/include/llvm/Target/TargetInstrDesc.h
    llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
    llvm/trunk/utils/TableGen/InstrInfoEmitter.h

Modified: llvm/trunk/include/llvm/Target/TargetInstrDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrDesc.h?rev=133964&r1=133963&r2=133964&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetInstrDesc.h (original)
+++ llvm/trunk/include/llvm/Target/TargetInstrDesc.h Mon Jun 27 18:47:21 2011
@@ -130,7 +130,6 @@
   uint64_t        TSFlags;       // Target Specific Flag values
   const unsigned *ImplicitUses;  // Registers implicitly read by this instr
   const unsigned *ImplicitDefs;  // Registers implicitly defined by this instr
-  const TargetRegisterClass **RCBarriers; // Reg classes completely "clobbered"
   const TargetOperandInfo *OpInfo; // 'NumOperands' entries about operands
 
   /// getOperandConstraint - Returns the value of the specific constraint if
@@ -251,17 +250,6 @@
     return false;
   }
 
-  /// getRegClassBarriers - Return a list of register classes that are
-  /// completely clobbered by this machine instruction. For example, on X86
-  /// the call instructions will completely clobber all the registers in the
-  /// fp stack and XMM classes.
-  ///
-  /// This method returns null if the instruction doesn't completely clobber
-  /// any register class.
-  const TargetRegisterClass **getRegClassBarriers() const {
-    return RCBarriers;
-  }
-
   /// getSchedClass - Return the scheduling class for this instruction.  The
   /// scheduling class is an index into the InstrItineraryData table.  This
   /// returns zero if there is no known scheduling information for the

Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=133964&r1=133963&r2=133964&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Mon Jun 27 18:47:21 2011
@@ -27,14 +27,6 @@
   OS << "0 };\n";
 }
 
-static void PrintBarriers(std::vector<Record*> &Barriers,
-                          unsigned Num, raw_ostream &OS) {
-  OS << "static const TargetRegisterClass* Barriers" << Num << "[] = { ";
-  for (unsigned i = 0, e = Barriers.size(); i != e; ++i)
-    OS << "&" << getQualifiedName(Barriers[i]) << "RegClass, ";
-  OS << "NULL };\n";
-}
-
 //===----------------------------------------------------------------------===//
 // Instruction Itinerary Information.
 //===----------------------------------------------------------------------===//
@@ -158,33 +150,6 @@
   }
 }
 
-void InstrInfoEmitter::DetectRegisterClassBarriers(std::vector<Record*> &Defs,
-                                  const std::vector<CodeGenRegisterClass> &RCs,
-                                  std::vector<Record*> &Barriers) {
-  std::set<Record*> DefSet;
-  unsigned NumDefs = Defs.size();
-  for (unsigned i = 0; i < NumDefs; ++i)
-    DefSet.insert(Defs[i]);
-
-  for (unsigned i = 0, e = RCs.size(); i != e; ++i) {
-    const CodeGenRegisterClass &RC = RCs[i];
-    ArrayRef<Record*> Order = RC.getOrder();
-    if (Order.size() > NumDefs)
-      continue; // Can't possibly clobber this RC.
-
-    bool Clobber = true;
-    for (unsigned j = 0; j < Order.size(); ++j) {
-      Record *Reg = Order[j];
-      if (!DefSet.count(Reg)) {
-        Clobber = false;
-        break;
-      }
-    }
-    if (Clobber)
-      Barriers.push_back(RC.TheDef);
-  }
-}
-
 //===----------------------------------------------------------------------===//
 // Main Output.
 //===----------------------------------------------------------------------===//
@@ -199,14 +164,10 @@
   CodeGenTarget &Target = CDP.getTargetInfo();
   const std::string &TargetName = Target.getName();
   Record *InstrInfo = Target.getInstructionSet();
-  const std::vector<CodeGenRegisterClass> &RCs = Target.getRegisterClasses();
 
   // Keep track of all of the def lists we have emitted already.
   std::map<std::vector<Record*>, unsigned> EmittedLists;
   unsigned ListNumber = 0;
-  std::map<std::vector<Record*>, unsigned> EmittedBarriers;
-  unsigned BarrierNumber = 0;
-  std::map<Record*, unsigned> BarriersMap;
 
   // Emit all of the instruction's implicit uses and defs.
   for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
@@ -219,14 +180,6 @@
     }
     std::vector<Record*> Defs = Inst->getValueAsListOfDefs("Defs");
     if (!Defs.empty()) {
-      std::vector<Record*> RCBarriers;
-      DetectRegisterClassBarriers(Defs, RCs, RCBarriers);
-      if (!RCBarriers.empty()) {
-        unsigned &IB = EmittedBarriers[RCBarriers];
-        if (!IB) PrintBarriers(RCBarriers, IB = ++BarrierNumber, OS);
-        BarriersMap.insert(std::make_pair(Inst, IB));
-      }
-
       unsigned &IL = EmittedLists[Defs];
       if (!IL) PrintDefList(Defs, IL = ++ListNumber, OS);
     }
@@ -246,7 +199,7 @@
 
   for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i)
     emitRecord(*NumberedInstructions[i], i, InstrInfo, EmittedLists,
-               BarriersMap, OperandInfoIDs, OS);
+               OperandInfoIDs, OS);
   OS << "};\n";
   OS << "} // End llvm namespace \n";
 }
@@ -254,7 +207,6 @@
 void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
                                   Record *InstrInfo,
                          std::map<std::vector<Record*>, unsigned> &EmittedLists,
-                                  std::map<Record*, unsigned> &BarriersMap,
                                   const OperandInfoMapTy &OpInfo,
                                   raw_ostream &OS) {
   int MinOperands = 0;
@@ -322,12 +274,6 @@
   else
     OS << "ImplicitList" << EmittedLists[DefList] << ", ";
 
-  std::map<Record*, unsigned>::iterator BI = BarriersMap.find(Inst.TheDef);
-  if (BI == BarriersMap.end())
-    OS << "NULL, ";
-  else
-    OS << "Barriers" << BI->second << ", ";
-
   // Emit the operand info.
   std::vector<std::string> OperandInfo = GetOperandInfo(Inst);
   if (OperandInfo.empty())

Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.h?rev=133964&r1=133963&r2=133964&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/InstrInfoEmitter.h (original)
+++ llvm/trunk/utils/TableGen/InstrInfoEmitter.h Mon Jun 27 18:47:21 2011
@@ -44,7 +44,6 @@
   void emitRecord(const CodeGenInstruction &Inst, unsigned Num,
                   Record *InstrInfo, 
                   std::map<std::vector<Record*>, unsigned> &EL,
-                  std::map<Record*, unsigned> &BM,
                   const OperandInfoMapTy &OpInfo,
                   raw_ostream &OS);
 





More information about the llvm-commits mailing list