recognize ppc's blr instruction as predicated

llvm-svn: 31480
This commit is contained in:
Chris Lattner 2006-11-06 21:44:54 +00:00
parent d7138e5f2d
commit 04b6336b73
3 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,7 @@ namespace llvm {
bool isLoad; bool isLoad;
bool isStore; bool isStore;
bool isTwoAddress; bool isTwoAddress;
bool isPredicated;
bool isConvertibleToThreeAddress; bool isConvertibleToThreeAddress;
bool isCommutable; bool isCommutable;
bool isTerminator; bool isTerminator;

View File

@ -335,6 +335,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
isLoad = R->getValueAsBit("isLoad"); isLoad = R->getValueAsBit("isLoad");
isStore = R->getValueAsBit("isStore"); isStore = R->getValueAsBit("isStore");
isTwoAddress = R->getValueAsBit("isTwoAddress"); isTwoAddress = R->getValueAsBit("isTwoAddress");
isPredicated = false; // set below.
isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress"); isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress");
isCommutable = R->getValueAsBit("isCommutable"); isCommutable = R->getValueAsBit("isCommutable");
isTerminator = R->getValueAsBit("isTerminator"); isTerminator = R->getValueAsBit("isTerminator");
@ -381,6 +382,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
if (unsigned NumArgs = MIOpInfo->getNumArgs()) if (unsigned NumArgs = MIOpInfo->getNumArgs())
NumOps = NumArgs; NumOps = NumArgs;
isPredicated |= Rec->isSubClassOf("PredicateOperand");
} else if (Rec->getName() == "variable_ops") { } else if (Rec->getName() == "variable_ops") {
hasVariableNumberOfOperands = true; hasVariableNumberOfOperands = true;
continue; continue;

View File

@ -225,6 +225,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
if (Inst.isLoad) OS << "|M_LOAD_FLAG"; if (Inst.isLoad) OS << "|M_LOAD_FLAG";
if (Inst.isStore || isStore) OS << "|M_STORE_FLAG"; if (Inst.isStore || isStore) OS << "|M_STORE_FLAG";
if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG"; if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG";
if (Inst.isPredicated) OS << "|M_PREDICATED";
if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR"; if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR";
if (Inst.isCommutable) OS << "|M_COMMUTABLE"; if (Inst.isCommutable) OS << "|M_COMMUTABLE";
if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG"; if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG";