forked from OSchip/llvm-project
remove some code that was working around old sparc v9 backend bugs.
Add checking that the input/output operand list in spelled right. llvm-svn: 98865
This commit is contained in:
parent
0204bc3de1
commit
5f418eafdc
|
@ -1145,7 +1145,8 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
|
||||||
CodeGenInstruction &InstInfo =
|
CodeGenInstruction &InstInfo =
|
||||||
CDP.getTargetInfo().getInstruction(getOperator()->getName());
|
CDP.getTargetInfo().getInstruction(getOperator()->getName());
|
||||||
// Apply the result type to the node
|
// Apply the result type to the node
|
||||||
if (NumResults == 0 || InstInfo.NumDefs == 0) {
|
if (NumResults == 0 ||
|
||||||
|
InstInfo.NumDefs == 0) {
|
||||||
MadeChange = UpdateNodeType(MVT::isVoid, TP);
|
MadeChange = UpdateNodeType(MVT::isVoid, TP);
|
||||||
} else {
|
} else {
|
||||||
Record *ResultNode = Inst.getResult(0);
|
Record *ResultNode = Inst.getResult(0);
|
||||||
|
|
|
@ -127,27 +127,27 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||||
if (neverHasSideEffects + hasSideEffects > 1)
|
if (neverHasSideEffects + hasSideEffects > 1)
|
||||||
throw R->getName() + ": multiple conflicting side-effect flags set!";
|
throw R->getName() + ": multiple conflicting side-effect flags set!";
|
||||||
|
|
||||||
DagInit *DI;
|
DagInit *DI = R->getValueAsDag("OutOperandList");
|
||||||
try {
|
|
||||||
DI = R->getValueAsDag("OutOperandList");
|
|
||||||
} catch (...) {
|
|
||||||
// Error getting operand list, just ignore it (sparcv9).
|
|
||||||
AsmString.clear();
|
|
||||||
OperandList.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
NumDefs = DI->getNumArgs();
|
|
||||||
|
|
||||||
DagInit *IDI;
|
if (DefInit *Init = dynamic_cast<DefInit*>(DI->getOperator())) {
|
||||||
try {
|
if (Init->getDef()->getName() != "ops" &&
|
||||||
IDI = R->getValueAsDag("InOperandList");
|
Init->getDef()->getName() != "outs")
|
||||||
} catch (...) {
|
throw R->getName() + ": invalid def name for output list: use 'outs'";
|
||||||
// Error getting operand list, just ignore it (sparcv9).
|
} else
|
||||||
AsmString.clear();
|
throw R->getName() + ": invalid output list: use 'outs'";
|
||||||
OperandList.clear();
|
|
||||||
return;
|
NumDefs = DI->getNumArgs();
|
||||||
}
|
|
||||||
DI = (DagInit*)(new BinOpInit(BinOpInit::CONCAT, DI, IDI, new DagRecTy))->Fold(R, 0);
|
DagInit *IDI = R->getValueAsDag("InOperandList");
|
||||||
|
if (DefInit *Init = dynamic_cast<DefInit*>(IDI->getOperator())) {
|
||||||
|
if (Init->getDef()->getName() != "ops" &&
|
||||||
|
Init->getDef()->getName() != "ins")
|
||||||
|
throw R->getName() + ": invalid def name for input list: use 'ins'";
|
||||||
|
} else
|
||||||
|
throw R->getName() + ": invalid input list: use 'ins'";
|
||||||
|
|
||||||
|
DI = (DagInit*)(new BinOpInit(BinOpInit::CONCAT,
|
||||||
|
DI, IDI, new DagRecTy))->Fold(R, 0);
|
||||||
|
|
||||||
unsigned MIOperandNo = 0;
|
unsigned MIOperandNo = 0;
|
||||||
std::set<std::string> OperandNames;
|
std::set<std::string> OperandNames;
|
||||||
|
|
|
@ -105,7 +105,8 @@ namespace llvm {
|
||||||
MINumOperands(MINO), MIOperandInfo(MIOI) {}
|
MINumOperands(MINO), MIOperandInfo(MIOI) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// NumDefs - Number of def operands declared.
|
/// NumDefs - Number of def operands declared, this is the number of
|
||||||
|
/// elements in the instruction's (outs) list.
|
||||||
///
|
///
|
||||||
unsigned NumDefs;
|
unsigned NumDefs;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue