Skip to content

Commit d32dd3e

Browse files
committed
fixup! Add a little more comment
1 parent c0bc72b commit d32dd3e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

llvm/include/llvm/Target/TargetSchedule.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ class MCSchedPredicate<MCInstPredicate P> : SchedPredicateBase {
377377
SchedMachineModel SchedModel = ?;
378378
}
379379

380+
// A scheduling predicate whose logic depends on a SubtargetFeature.
380381
class FeatureSchedPredicate<SubtargetFeature SF> : SchedPredicateBase {
381382
SubtargetFeature Feature = SF;
382383
SchedMachineModel SchedModel = ?;

llvm/utils/TableGen/SubtargetEmitter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,14 @@ static void emitPredicates(const CodeGenSchedTransition &T,
15891589
if (Rec->isSubClassOf("FeatureSchedPredicate")) {
15901590
const Record *FR = Rec->getValueAsDef("Feature");
15911591
if (PE.shouldExpandForMC())
1592+
// MC version of this predicate will be emitted into
1593+
// resolveVariantSchedClassImpl, which accesses MCSubtargetInfo
1594+
// through argument STI.
15921595
SS << "STI.";
15931596
else
1597+
// Otherwise, this predicate will be emitted directly into
1598+
// TargetGenSubtargetInfo::resolveSchedClass, which can just access
1599+
// TargetSubtargetInfo / MCSubtargetInfo through `this`.
15941600
SS << "this->";
15951601
SS << "hasFeature(" << PE.getTargetName() << "::" << FR->getName()
15961602
<< ")";

0 commit comments

Comments
 (0)