[llvm-commits] [llvm] r45641 - in /llvm/trunk/utils/TableGen: CodeGenDAGPatterns.cpp CodeGenDAGPatterns.h DAGISelEmitter.cpp DAGISelEmitter.h
Chris Lattner
sabre at nondot.org
Sat Jan 5 17:10:34 PST 2008
Author: lattner
Date: Sat Jan 5 19:10:31 2008
New Revision: 45641
URL: http://llvm.org/viewvc/llvm-project?rev=45641&view=rev
Log:
rename CodegenDAGPatterns -> CodeGenDAGPatterns
Modified:
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
llvm/trunk/utils/TableGen/DAGISelEmitter.h
Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=45641&r1=45640&r2=45641&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Sat Jan 5 19:10:31 2008
@@ -1,4 +1,4 @@
-//===- CodegenDAGPatterns.cpp - Read DAG patterns from .td file -----------===//
+//===- CodeGenDAGPatterns.cpp - Read DAG patterns from .td file -----------===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the CodegenDAGPatterns class, which is used to read and
+// This file implements the CodeGenDAGPatterns class, which is used to read and
// represent the patterns present in a .td file for instructions.
//
//===----------------------------------------------------------------------===//
@@ -638,7 +638,7 @@
/// change, false otherwise. If a type contradiction is found, throw an
/// exception.
bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
- CodegenDAGPatterns &CDP = TP.getDAGPatterns();
+ CodeGenDAGPatterns &CDP = TP.getDAGPatterns();
if (isLeaf()) {
if (DefInit *DI = dynamic_cast<DefInit*>(getLeafValue())) {
// If it's a regclass or something else known, include the type.
@@ -862,7 +862,7 @@
/// that can never possibly work), and to prevent the pattern permuter from
/// generating stuff that is useless.
bool TreePatternNode::canPatternMatch(std::string &Reason,
- CodegenDAGPatterns &CDP){
+ CodeGenDAGPatterns &CDP){
if (isLeaf()) return true;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
@@ -899,20 +899,20 @@
//
TreePattern::TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
- CodegenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
+ CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
isInputPattern = isInput;
for (unsigned i = 0, e = RawPat->getSize(); i != e; ++i)
Trees.push_back(ParseTreePattern((DagInit*)RawPat->getElement(i)));
}
TreePattern::TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
- CodegenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
+ CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
isInputPattern = isInput;
Trees.push_back(ParseTreePattern(Pat));
}
TreePattern::TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput,
- CodegenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
+ CodeGenDAGPatterns &cdp) : TheRecord(TheRec), CDP(cdp){
isInputPattern = isInput;
Trees.push_back(Pat);
}
@@ -1106,11 +1106,11 @@
void TreePattern::dump() const { print(*cerr.stream()); }
//===----------------------------------------------------------------------===//
-// CodegenDAGPatterns implementation
+// CodeGenDAGPatterns implementation
//
// FIXME: REMOVE OSTREAM ARGUMENT
-CodegenDAGPatterns::CodegenDAGPatterns(RecordKeeper &R) : Records(R) {
+CodeGenDAGPatterns::CodeGenDAGPatterns(RecordKeeper &R) : Records(R) {
Intrinsics = LoadIntrinsics(Records);
ParseNodeInfo();
ParseNodeTransforms();
@@ -1125,14 +1125,14 @@
GenerateVariants();
}
-CodegenDAGPatterns::~CodegenDAGPatterns() {
+CodeGenDAGPatterns::~CodeGenDAGPatterns() {
for (std::map<Record*, TreePattern*>::iterator I = PatternFragments.begin(),
E = PatternFragments.end(); I != E; ++I)
delete I->second;
}
-Record *CodegenDAGPatterns::getSDNodeNamed(const std::string &Name) const {
+Record *CodeGenDAGPatterns::getSDNodeNamed(const std::string &Name) const {
Record *N = Records.getDef(Name);
if (!N || !N->isSubClassOf("SDNode")) {
cerr << "Error getting SDNode '" << Name << "'!\n";
@@ -1142,7 +1142,7 @@
}
// Parse all of the SDNode definitions for the target, populating SDNodes.
-void CodegenDAGPatterns::ParseNodeInfo() {
+void CodeGenDAGPatterns::ParseNodeInfo() {
std::vector<Record*> Nodes = Records.getAllDerivedDefinitions("SDNode");
while (!Nodes.empty()) {
SDNodes.insert(std::make_pair(Nodes.back(), Nodes.back()));
@@ -1157,7 +1157,7 @@
/// ParseNodeTransforms - Parse all SDNodeXForm instances into the SDNodeXForms
/// map, and emit them to the file as functions.
-void CodegenDAGPatterns::ParseNodeTransforms() {
+void CodeGenDAGPatterns::ParseNodeTransforms() {
std::vector<Record*> Xforms = Records.getAllDerivedDefinitions("SDNodeXForm");
while (!Xforms.empty()) {
Record *XFormNode = Xforms.back();
@@ -1169,7 +1169,7 @@
}
}
-void CodegenDAGPatterns::ParseComplexPatterns() {
+void CodeGenDAGPatterns::ParseComplexPatterns() {
std::vector<Record*> AMs = Records.getAllDerivedDefinitions("ComplexPattern");
while (!AMs.empty()) {
ComplexPatterns.insert(std::make_pair(AMs.back(), AMs.back()));
@@ -1183,7 +1183,7 @@
/// inline fragments together as necessary, so that there are no references left
/// inside a pattern fragment to a pattern fragment.
///
-void CodegenDAGPatterns::ParsePatternFragments() {
+void CodeGenDAGPatterns::ParsePatternFragments() {
std::vector<Record*> Fragments = Records.getAllDerivedDefinitions("PatFrag");
// First step, parse all of the fragments.
@@ -1266,7 +1266,7 @@
}
}
-void CodegenDAGPatterns::ParseDefaultOperands() {
+void CodeGenDAGPatterns::ParseDefaultOperands() {
std::vector<Record*> DefaultOps[2];
DefaultOps[0] = Records.getAllDerivedDefinitions("PredicateOperand");
DefaultOps[1] = Records.getAllDerivedDefinitions("OptionalDefOperand");
@@ -1373,7 +1373,7 @@
/// FindPatternInputsAndOutputs - Scan the specified TreePatternNode (which is
/// part of "I", the instruction), computing the set of inputs and outputs of
/// the pattern. Report errors if we see anything naughty.
-void CodegenDAGPatterns::
+void CodeGenDAGPatterns::
FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
std::map<std::string, TreePatternNode*> &InstInputs,
std::map<std::string, TreePatternNode*>&InstResults,
@@ -1458,7 +1458,7 @@
/// ParseInstructions - Parse all of the instructions, inlining and resolving
/// any fragments involved. This populates the Instructions list with fully
/// resolved instructions.
-void CodegenDAGPatterns::ParseInstructions() {
+void CodeGenDAGPatterns::ParseInstructions() {
std::vector<Record*> Instrs = Records.getAllDerivedDefinitions("Instruction");
for (unsigned i = 0, e = Instrs.size(); i != e; ++i) {
@@ -1688,7 +1688,7 @@
}
}
-void CodegenDAGPatterns::ParsePatterns() {
+void CodeGenDAGPatterns::ParsePatterns() {
std::vector<Record*> Patterns = Records.getAllDerivedDefinitions("Pattern");
for (unsigned i = 0, e = Patterns.size(); i != e; ++i) {
@@ -1798,7 +1798,7 @@
static void CombineChildVariants(TreePatternNode *Orig,
const std::vector<std::vector<TreePatternNode*> > &ChildVariants,
std::vector<TreePatternNode*> &OutVariants,
- CodegenDAGPatterns &CDP) {
+ CodeGenDAGPatterns &CDP) {
// Make sure that each operand has at least one variant to choose from.
for (unsigned i = 0, e = ChildVariants.size(); i != e; ++i)
if (ChildVariants[i].empty())
@@ -1863,7 +1863,7 @@
const std::vector<TreePatternNode*> &LHS,
const std::vector<TreePatternNode*> &RHS,
std::vector<TreePatternNode*> &OutVariants,
- CodegenDAGPatterns &CDP) {
+ CodeGenDAGPatterns &CDP) {
std::vector<std::vector<TreePatternNode*> > ChildVariants;
ChildVariants.push_back(LHS);
ChildVariants.push_back(RHS);
@@ -1899,7 +1899,7 @@
///
static void GenerateVariantsOf(TreePatternNode *N,
std::vector<TreePatternNode*> &OutVariants,
- CodegenDAGPatterns &CDP) {
+ CodeGenDAGPatterns &CDP) {
// We cannot permute leaves.
if (N->isLeaf()) {
OutVariants.push_back(N);
@@ -1995,7 +1995,7 @@
// GenerateVariants - Generate variants. For example, commutative patterns can
// match multiple ways. Add them to PatternsToMatch as well.
-void CodegenDAGPatterns::GenerateVariants() {
+void CodeGenDAGPatterns::GenerateVariants() {
DOUT << "Generating instruction variants.\n";
// Loop over all of the patterns we've collected, checking to see if we can
Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=45641&r1=45640&r2=45641&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Sat Jan 5 19:10:31 2008
@@ -1,4 +1,4 @@
-//===- CodegenDAGPatterns.h - Read DAG patterns from .td file ---*- C++ -*-===//
+//===- CodeGenDAGPatterns.h - Read DAG patterns from .td file ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file declares the CodegenDAGPatterns class, which is used to read and
+// This file declares the CodeGenDAGPatterns class, which is used to read and
// represent the patterns present in a .td file for instructions.
//
//===----------------------------------------------------------------------===//
@@ -27,7 +27,7 @@
class SDNodeInfo;
class TreePattern;
class TreePatternNode;
- class CodegenDAGPatterns;
+ class CodeGenDAGPatterns;
class ComplexPattern;
/// MVT::DAGISelGenValueType - These are some extended forms of MVT::ValueType
@@ -264,7 +264,7 @@
/// canPatternMatch - If it is impossible for this pattern to match on this
/// target, fill in Reason and return false. Otherwise, return true.
- bool canPatternMatch(std::string &Reason, CodegenDAGPatterns &CDP);
+ bool canPatternMatch(std::string &Reason, CodeGenDAGPatterns &CDP);
};
@@ -287,7 +287,7 @@
/// CDP - the top-level object coordinating this madness.
///
- CodegenDAGPatterns &CDP;
+ CodeGenDAGPatterns &CDP;
/// isInputPattern - True if this is an input pattern, something to match.
/// False if this is an output pattern, something to emit.
@@ -297,11 +297,11 @@
/// TreePattern constructor - Parse the specified DagInits into the
/// current record.
TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
- CodegenDAGPatterns &ise);
+ CodeGenDAGPatterns &ise);
TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
- CodegenDAGPatterns &ise);
+ CodeGenDAGPatterns &ise);
TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput,
- CodegenDAGPatterns &ise);
+ CodeGenDAGPatterns &ise);
/// getTrees - Return the tree patterns which corresponds to this pattern.
///
@@ -325,7 +325,7 @@
}
std::vector<std::string> &getArgList() { return Args; }
- CodegenDAGPatterns &getDAGPatterns() const { return CDP; }
+ CodeGenDAGPatterns &getDAGPatterns() const { return CDP; }
/// InlinePatternFragments - If this pattern refers to any pattern
/// fragments, inline them into place, giving us a pattern without any
@@ -406,7 +406,7 @@
TreePatternNode *getResultPattern() const { return ResultPattern; }
};
-/// PatternToMatch - Used by CodegenDAGPatterns to keep tab of patterns
+/// PatternToMatch - Used by CodeGenDAGPatterns to keep tab of patterns
/// processed to produce isel.
struct PatternToMatch {
PatternToMatch(ListInit *preds,
@@ -430,7 +430,7 @@
};
-class CodegenDAGPatterns {
+class CodeGenDAGPatterns {
RecordKeeper &Records;
CodeGenTarget Target;
std::vector<CodeGenIntrinsic> Intrinsics;
@@ -451,8 +451,8 @@
/// emit.
std::vector<PatternToMatch> PatternsToMatch;
public:
- CodegenDAGPatterns(RecordKeeper &R);
- ~CodegenDAGPatterns();
+ CodeGenDAGPatterns(RecordKeeper &R);
+ ~CodeGenDAGPatterns();
const CodeGenTarget &getTargetInfo() const { return Target; }
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=45641&r1=45640&r2=45641&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Sat Jan 5 19:10:31 2008
@@ -36,7 +36,7 @@
/// NodeGetComplexPattern - return the pointer to the ComplexPattern if N
/// is a leaf node and a subclass of ComplexPattern, else it returns NULL.
static const ComplexPattern *NodeGetComplexPattern(TreePatternNode *N,
- CodegenDAGPatterns &CGP) {
+ CodeGenDAGPatterns &CGP) {
if (N->isLeaf() &&
dynamic_cast<DefInit*>(N->getLeafValue()) &&
static_cast<DefInit*>(N->getLeafValue())->getDef()->
@@ -50,7 +50,7 @@
/// getPatternSize - Return the 'size' of this pattern. We want to match large
/// patterns before small ones. This is used to determine the size of a
/// pattern.
-static unsigned getPatternSize(TreePatternNode *P, CodegenDAGPatterns &CGP) {
+static unsigned getPatternSize(TreePatternNode *P, CodeGenDAGPatterns &CGP) {
assert((MVT::isExtIntegerInVTs(P->getExtTypes()) ||
MVT::isExtFloatingPointInVTs(P->getExtTypes()) ||
P->getExtTypeNum(0) == MVT::isVoid ||
@@ -99,7 +99,7 @@
/// This is a temporary hack. We should really include the instruction
/// latencies in this calculation.
static unsigned getResultPatternCost(TreePatternNode *P,
- CodegenDAGPatterns &CGP) {
+ CodeGenDAGPatterns &CGP) {
if (P->isLeaf()) return 0;
unsigned Cost = 0;
@@ -118,7 +118,7 @@
/// getResultPatternCodeSize - Compute the code size of instructions for this
/// pattern.
static unsigned getResultPatternSize(TreePatternNode *P,
- CodegenDAGPatterns &CGP) {
+ CodeGenDAGPatterns &CGP) {
if (P->isLeaf()) return 0;
unsigned Cost = 0;
@@ -135,8 +135,8 @@
// In particular, we want to match maximal patterns first and lowest cost within
// a particular complexity first.
struct PatternSortingPredicate {
- PatternSortingPredicate(CodegenDAGPatterns &cgp) : CGP(cgp) {}
- CodegenDAGPatterns &CGP;
+ PatternSortingPredicate(CodeGenDAGPatterns &cgp) : CGP(cgp) {}
+ CodeGenDAGPatterns &CGP;
bool operator()(const PatternToMatch *LHS,
const PatternToMatch *RHS) {
@@ -179,7 +179,7 @@
/// NodeHasProperty - return true if TreePatternNode has the specified
/// property.
static bool NodeHasProperty(TreePatternNode *N, SDNP Property,
- CodegenDAGPatterns &CGP) {
+ CodeGenDAGPatterns &CGP) {
if (N->isLeaf()) {
const ComplexPattern *CP = NodeGetComplexPattern(N, CGP);
if (CP)
@@ -193,7 +193,7 @@
}
static bool PatternHasProperty(TreePatternNode *N, SDNP Property,
- CodegenDAGPatterns &CGP) {
+ CodeGenDAGPatterns &CGP) {
if (NodeHasProperty(N, Property, CGP))
return true;
@@ -212,10 +212,10 @@
void DAGISelEmitter::EmitNodeTransforms(std::ostream &OS) {
// Walk the pattern fragments, adding them to a map, which sorts them by
// name.
- typedef std::map<std::string, CodegenDAGPatterns::NodeXForm> NXsByNameTy;
+ typedef std::map<std::string, CodeGenDAGPatterns::NodeXForm> NXsByNameTy;
NXsByNameTy NXsByName;
- for (CodegenDAGPatterns::nx_iterator I = CGP.nx_begin(), E = CGP.nx_end();
+ for (CodeGenDAGPatterns::nx_iterator I = CGP.nx_begin(), E = CGP.nx_end();
I != E; ++I)
NXsByName.insert(std::make_pair(I->first->getName(), I->second));
@@ -251,7 +251,7 @@
typedef std::map<std::string, std::pair<Record*, TreePattern*> > PFsByNameTy;
PFsByNameTy PFsByName;
- for (CodegenDAGPatterns::pf_iterator I = CGP.pf_begin(), E = CGP.pf_end();
+ for (CodeGenDAGPatterns::pf_iterator I = CGP.pf_begin(), E = CGP.pf_end();
I != E; ++I)
PFsByName.insert(std::make_pair(I->first->getName(), *I));
@@ -290,7 +290,7 @@
//
class PatternCodeEmitter {
private:
- CodegenDAGPatterns &CGP;
+ CodeGenDAGPatterns &CGP;
// Predicates.
ListInit *Predicates;
@@ -354,7 +354,7 @@
VTNo++;
}
public:
- PatternCodeEmitter(CodegenDAGPatterns &cgp, ListInit *preds,
+ PatternCodeEmitter(CodeGenDAGPatterns &cgp, ListInit *preds,
TreePatternNode *pattern, TreePatternNode *instr,
std::vector<std::pair<unsigned, std::string> > &gc,
std::set<std::string> &gd,
@@ -1461,7 +1461,7 @@
OS << std::string(Indent-2, ' ') << "}\n";
}
-static std::string getOpcodeName(Record *Op, CodegenDAGPatterns &CGP) {
+static std::string getOpcodeName(Record *Op, CodeGenDAGPatterns &CGP) {
return CGP.getSDNodeInfo(Op).getEnumName();
}
@@ -1492,7 +1492,7 @@
std::map<std::string, std::vector<const PatternToMatch*> > PatternsByOpcode;
// All unique target node emission functions.
std::map<std::string, unsigned> EmitFunctions;
- for (CodegenDAGPatterns::ptm_iterator I = CGP.ptm_begin(),
+ for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(),
E = CGP.ptm_end(); I != E; ++I) {
const PatternToMatch &Pattern = *I;
@@ -2046,7 +2046,7 @@
EmitPredicateFunctions(OS);
DOUT << "\n\nALL PATTERNS TO MATCH:\n\n";
- for (CodegenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
+ for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
I != E; ++I) {
DOUT << "PATTERN: "; DEBUG(I->getSrcPattern()->dump());
DOUT << "\nRESULT: "; DEBUG(I->getDstPattern()->dump());
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.h?rev=45641&r1=45640&r2=45641&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.h (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.h Sat Jan 5 19:10:31 2008
@@ -24,7 +24,7 @@
///
class DAGISelEmitter : public TableGenBackend {
RecordKeeper &Records;
- CodegenDAGPatterns CGP;
+ CodeGenDAGPatterns CGP;
public:
DAGISelEmitter(RecordKeeper &R) : Records(R), CGP(R) {}
More information about the llvm-commits
mailing list