mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
stop computing InstImpInputs, it is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101881 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1992,16 +1992,13 @@ void CodeGenDAGPatterns::ParseDefaultOperands() {
|
|||||||
/// HandleUse - Given "Pat" a leaf in the pattern, check to see if it is an
|
/// HandleUse - Given "Pat" a leaf in the pattern, check to see if it is an
|
||||||
/// instruction input. Return true if this is a real use.
|
/// instruction input. Return true if this is a real use.
|
||||||
static bool HandleUse(TreePattern *I, TreePatternNode *Pat,
|
static bool HandleUse(TreePattern *I, TreePatternNode *Pat,
|
||||||
std::map<std::string, TreePatternNode*> &InstInputs,
|
std::map<std::string, TreePatternNode*> &InstInputs) {
|
||||||
std::vector<Record*> &InstImpInputs) {
|
|
||||||
// No name -> not interesting.
|
// No name -> not interesting.
|
||||||
if (Pat->getName().empty()) {
|
if (Pat->getName().empty()) {
|
||||||
if (Pat->isLeaf()) {
|
if (Pat->isLeaf()) {
|
||||||
DefInit *DI = dynamic_cast<DefInit*>(Pat->getLeafValue());
|
DefInit *DI = dynamic_cast<DefInit*>(Pat->getLeafValue());
|
||||||
if (DI && DI->getDef()->isSubClassOf("RegisterClass"))
|
if (DI && DI->getDef()->isSubClassOf("RegisterClass"))
|
||||||
I->error("Input " + DI->getDef()->getName() + " must be named!");
|
I->error("Input " + DI->getDef()->getName() + " must be named!");
|
||||||
else if (DI && DI->getDef()->isSubClassOf("Register"))
|
|
||||||
InstImpInputs.push_back(DI->getDef());
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2047,10 +2044,9 @@ void CodeGenDAGPatterns::
|
|||||||
FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
|
FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
|
||||||
std::map<std::string, TreePatternNode*> &InstInputs,
|
std::map<std::string, TreePatternNode*> &InstInputs,
|
||||||
std::map<std::string, TreePatternNode*>&InstResults,
|
std::map<std::string, TreePatternNode*>&InstResults,
|
||||||
std::vector<Record*> &InstImpInputs,
|
|
||||||
std::vector<Record*> &InstImpResults) {
|
std::vector<Record*> &InstImpResults) {
|
||||||
if (Pat->isLeaf()) {
|
if (Pat->isLeaf()) {
|
||||||
bool isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
|
bool isUse = HandleUse(I, Pat, InstInputs);
|
||||||
if (!isUse && Pat->getTransformFn())
|
if (!isUse && Pat->getTransformFn())
|
||||||
I->error("Cannot specify a transform function for a non-input value!");
|
I->error("Cannot specify a transform function for a non-input value!");
|
||||||
return;
|
return;
|
||||||
@@ -2077,12 +2073,12 @@ FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
|
|||||||
if (Pat->getChild(i)->getNumTypes() == 0)
|
if (Pat->getChild(i)->getNumTypes() == 0)
|
||||||
I->error("Cannot have void nodes inside of patterns!");
|
I->error("Cannot have void nodes inside of patterns!");
|
||||||
FindPatternInputsAndOutputs(I, Pat->getChild(i), InstInputs, InstResults,
|
FindPatternInputsAndOutputs(I, Pat->getChild(i), InstInputs, InstResults,
|
||||||
InstImpInputs, InstImpResults);
|
InstImpResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a non-leaf node with no children, treat it basically as if
|
// If this is a non-leaf node with no children, treat it basically as if
|
||||||
// it were a leaf. This handles nodes like (imm).
|
// it were a leaf. This handles nodes like (imm).
|
||||||
bool isUse = HandleUse(I, Pat, InstInputs, InstImpInputs);
|
bool isUse = HandleUse(I, Pat, InstInputs);
|
||||||
|
|
||||||
if (!isUse && Pat->getTransformFn())
|
if (!isUse && Pat->getTransformFn())
|
||||||
I->error("Cannot specify a transform function for a non-input value!");
|
I->error("Cannot specify a transform function for a non-input value!");
|
||||||
@@ -2123,8 +2119,7 @@ FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
|
|||||||
|
|
||||||
// Verify and collect info from the computation.
|
// Verify and collect info from the computation.
|
||||||
FindPatternInputsAndOutputs(I, Pat->getChild(NumDests),
|
FindPatternInputsAndOutputs(I, Pat->getChild(NumDests),
|
||||||
InstInputs, InstResults,
|
InstInputs, InstResults, InstImpResults);
|
||||||
InstImpInputs, InstImpResults);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
@@ -2320,7 +2315,6 @@ void CodeGenDAGPatterns::ParseInstructions() {
|
|||||||
// in the instruction, including what reg class they are.
|
// in the instruction, including what reg class they are.
|
||||||
std::map<std::string, TreePatternNode*> InstResults;
|
std::map<std::string, TreePatternNode*> InstResults;
|
||||||
|
|
||||||
std::vector<Record*> InstImpInputs;
|
|
||||||
std::vector<Record*> InstImpResults;
|
std::vector<Record*> InstImpResults;
|
||||||
|
|
||||||
// Verify that the top-level forms in the instruction are of void type, and
|
// Verify that the top-level forms in the instruction are of void type, and
|
||||||
@@ -2333,7 +2327,7 @@ void CodeGenDAGPatterns::ParseInstructions() {
|
|||||||
|
|
||||||
// Find inputs and outputs, and verify the structure of the uses/defs.
|
// Find inputs and outputs, and verify the structure of the uses/defs.
|
||||||
FindPatternInputsAndOutputs(I, Pat, InstInputs, InstResults,
|
FindPatternInputsAndOutputs(I, Pat, InstInputs, InstResults,
|
||||||
InstImpInputs, InstImpResults);
|
InstImpResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we have inputs and outputs of the pattern, inspect the operands
|
// Now that we have inputs and outputs of the pattern, inspect the operands
|
||||||
@@ -2443,8 +2437,7 @@ void CodeGenDAGPatterns::ParseInstructions() {
|
|||||||
ResultPattern->setType(i, Res0Node->getExtType(i));
|
ResultPattern->setType(i, Res0Node->getExtType(i));
|
||||||
|
|
||||||
// Create and insert the instruction.
|
// Create and insert the instruction.
|
||||||
// FIXME: InstImpResults and InstImpInputs should not be part of
|
// FIXME: InstImpResults should not be part of DAGInstruction.
|
||||||
// DAGInstruction.
|
|
||||||
DAGInstruction TheInst(I, Results, Operands, InstImpResults);
|
DAGInstruction TheInst(I, Results, Operands, InstImpResults);
|
||||||
Instructions.insert(std::make_pair(I->getRecord(), TheInst));
|
Instructions.insert(std::make_pair(I->getRecord(), TheInst));
|
||||||
|
|
||||||
@@ -2680,12 +2673,11 @@ void CodeGenDAGPatterns::ParsePatterns() {
|
|||||||
// Validate that the input pattern is correct.
|
// Validate that the input pattern is correct.
|
||||||
std::map<std::string, TreePatternNode*> InstInputs;
|
std::map<std::string, TreePatternNode*> InstInputs;
|
||||||
std::map<std::string, TreePatternNode*> InstResults;
|
std::map<std::string, TreePatternNode*> InstResults;
|
||||||
std::vector<Record*> InstImpInputs;
|
|
||||||
std::vector<Record*> InstImpResults;
|
std::vector<Record*> InstImpResults;
|
||||||
for (unsigned j = 0, ee = Pattern->getNumTrees(); j != ee; ++j)
|
for (unsigned j = 0, ee = Pattern->getNumTrees(); j != ee; ++j)
|
||||||
FindPatternInputsAndOutputs(Pattern, Pattern->getTree(j),
|
FindPatternInputsAndOutputs(Pattern, Pattern->getTree(j),
|
||||||
InstInputs, InstResults,
|
InstInputs, InstResults,
|
||||||
InstImpInputs, InstImpResults);
|
InstImpResults);
|
||||||
|
|
||||||
// Promote the xform function to be an explicit node if set.
|
// Promote the xform function to be an explicit node if set.
|
||||||
TreePatternNode *DstPattern = Result->getOnlyTree();
|
TreePatternNode *DstPattern = Result->getOnlyTree();
|
||||||
|
@@ -741,7 +741,6 @@ private:
|
|||||||
TreePatternNode*> &InstInputs,
|
TreePatternNode*> &InstInputs,
|
||||||
std::map<std::string,
|
std::map<std::string,
|
||||||
TreePatternNode*> &InstResults,
|
TreePatternNode*> &InstResults,
|
||||||
std::vector<Record*> &InstImpInputs,
|
|
||||||
std::vector<Record*> &InstImpResults);
|
std::vector<Record*> &InstImpResults);
|
||||||
};
|
};
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
Reference in New Issue
Block a user