Skip to content

Commit

Permalink
TableGen: Add hasNoSchedulingInfo to instructions
Browse files Browse the repository at this point in the history
This introduces a new flag that indicates that a specific instruction
will never be present when the MachineScheduler runs and therefore needs
no scheduling information.

This is in preparation for an upcoming commit which checks completeness
of a scheduling model when tablegen runs.

Differential Revision: http://reviews.llvm.org/D17728

llvm-svn: 262383
  • Loading branch information
MatzeB committed Mar 1, 2016
1 parent 8f1b1f5 commit 8e0a734
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion llvm/include/llvm/Target/Target.td
Expand Up @@ -427,6 +427,11 @@ class Instruction {
// Is this instruction a pseudo instruction for use by the assembler parser.
bit isAsmParserOnly = 0;

// This instruction is not expected to be queried for scheduling latencies
// and therefore needs no scheduling information even for a complete
// scheduling model.
bit hasNoSchedulingInfo = 0;

InstrItinClass Itinerary = NoItinerary;// Execution steps used for scheduling.

// Scheduling information from TargetSchedule.td.
Expand Down Expand Up @@ -765,7 +770,8 @@ class InstrInfo {
// Standard Pseudo Instructions.
// This list must match TargetOpcodes.h and CodeGenTarget.cpp.
// Only these instructions are allowed in the TargetOpcode namespace.
let isCodeGenOnly = 1, isPseudo = 1, Namespace = "TargetOpcode" in {
let isCodeGenOnly = 1, isPseudo = 1, hasNoSchedulingInfo = 1,
Namespace = "TargetOpcode" in {
def PHI : Instruction {
let OutOperandList = (outs);
let InOperandList = (ins variable_ops);
Expand Down Expand Up @@ -857,6 +863,7 @@ def COPY : Instruction {
let AsmString = "";
let hasSideEffects = 0;
let isAsCheapAsAMove = 1;
let hasNoSchedulingInfo = 0;
}
def BUNDLE : Instruction {
let OutOperandList = (outs);
Expand Down
1 change: 1 addition & 0 deletions llvm/utils/TableGen/CodeGenInstruction.cpp
Expand Up @@ -324,6 +324,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R)
isExtractSubreg = R->getValueAsBit("isExtractSubreg");
isInsertSubreg = R->getValueAsBit("isInsertSubreg");
isConvergent = R->getValueAsBit("isConvergent");
hasNoSchedulingInfo = R->getValueAsBit("hasNoSchedulingInfo");

bool Unset;
mayLoad = R->getValueAsBitOrUnset("mayLoad", Unset);
Expand Down
1 change: 1 addition & 0 deletions llvm/utils/TableGen/CodeGenInstruction.h
Expand Up @@ -257,6 +257,7 @@ namespace llvm {
bool isExtractSubreg : 1;
bool isInsertSubreg : 1;
bool isConvergent : 1;
bool hasNoSchedulingInfo : 1;

std::string DeprecatedReason;
bool HasComplexDeprecationPredicate;
Expand Down
3 changes: 2 additions & 1 deletion llvm/utils/TableGen/CodeGenSchedule.cpp
Expand Up @@ -527,7 +527,8 @@ void CodeGenSchedModels::collectSchedClasses() {
std::string InstName = Inst->TheDef->getName();
unsigned SCIdx = InstrClassMap.lookup(Inst->TheDef);
if (!SCIdx) {
dbgs() << "No machine model for " << Inst->TheDef->getName() << '\n';
if (!Inst->hasNoSchedulingInfo)
dbgs() << "No machine model for " << Inst->TheDef->getName() << '\n';
continue;
}
CodeGenSchedClass &SC = getSchedClass(SCIdx);
Expand Down

0 comments on commit 8e0a734

Please sign in to comment.