[llvm-commits] [llvm] r112924 - in /llvm/trunk/utils/TableGen: DAGISelEmitter.cpp DAGISelEmitter.h

Jim Grosbach grosbach at apple.com
Thu Sep 2 19:32:11 PDT 2010


Woot! Very nice.

On Sep 2, 2010, at 5:39 PM, Jakob Stoklund Olesen wrote:

> Author: stoklund
> Date: Thu Sep  2 19:39:50 2010
> New Revision: 112924
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=112924&view=rev
> Log:
> Stop emitting predicate functions. They are no longer used.
> 
> Modified:
>    llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
>    llvm/trunk/utils/TableGen/DAGISelEmitter.h
> 
> Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=112924&r1=112923&r2=112924&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Sep  2 19:39:50 2010
> @@ -57,51 +57,6 @@
>   return Cost;
> }
> 
> -//===----------------------------------------------------------------------===//
> -// Predicate emitter implementation.
> -//
> -
> -void DAGISelEmitter::EmitPredicateFunctions(raw_ostream &OS) {
> -  OS << "\n// Predicate functions.\n";
> -
> -  // Walk the pattern fragments, adding them to a map, which sorts them by
> -  // name.
> -  typedef std::map<std::string, std::pair<Record*, TreePattern*> > PFsByNameTy;
> -  PFsByNameTy PFsByName;
> -
> -  for (CodeGenDAGPatterns::pf_iterator I = CGP.pf_begin(), E = CGP.pf_end();
> -       I != E; ++I)
> -    PFsByName.insert(std::make_pair(I->first->getName(), *I));
> -
> -  
> -  for (PFsByNameTy::iterator I = PFsByName.begin(), E = PFsByName.end();
> -       I != E; ++I) {
> -    Record *PatFragRecord = I->second.first;// Record that derives from PatFrag.
> -    TreePattern *P = I->second.second;
> -    
> -    // If there is a code init for this fragment, emit the predicate code.
> -    std::string Code = PatFragRecord->getValueAsCode("Predicate");
> -    if (Code.empty()) continue;
> -    
> -    if (P->getOnlyTree()->isLeaf())
> -      OS << "inline bool Predicate_" << PatFragRecord->getName()
> -      << "(SDNode *N) const {\n";
> -    else {
> -      std::string ClassName =
> -        CGP.getSDNodeInfo(P->getOnlyTree()->getOperator()).getSDClassName();
> -      const char *C2 = ClassName == "SDNode" ? "N" : "inN";
> -      
> -      OS << "inline bool Predicate_" << PatFragRecord->getName()
> -         << "(SDNode *" << C2 << ") const {\n";
> -      if (ClassName != "SDNode")
> -        OS << "  " << ClassName << " *N = cast<" << ClassName << ">(inN);\n";
> -    }
> -    OS << Code << "\n}\n";
> -  }
> -  
> -  OS << "\n\n";
> -}
> -
> namespace {
> // PatternSortingPredicate - return true if we prefer to match LHS before RHS.
> // In particular, we want to match maximal patterns first and lowest cost within
> @@ -168,9 +123,6 @@
>           errs() << "\n";
>         });
> 
> -  // FIXME: These are being used by hand written code, gross.
> -  EmitPredicateFunctions(OS);
> -
>   // Add all the patterns to a temporary list so we can sort them.
>   std::vector<const PatternToMatch*> Patterns;
>   for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
> 
> Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.h?rev=112924&r1=112923&r2=112924&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/DAGISelEmitter.h (original)
> +++ llvm/trunk/utils/TableGen/DAGISelEmitter.h Thu Sep  2 19:39:50 2010
> @@ -31,8 +31,6 @@
> 
>   // run - Output the isel, returning true on failure.
>   void run(raw_ostream &OS);
> -private:
> -  void EmitPredicateFunctions(raw_ostream &OS);
> };
> 
> } // End llvm namespace
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list