// CHECK-NEXT: return Features;
// CHECK-NEXT: }
-// CHECK-LABEL: enum {
+// CHECK-LABEL: // LLT Objects.
+// CHECK-NEXT: enum {
// CHECK-NEXT: GILLT_s32,
// CHECK-NEXT: }
// CHECK-NEXT: const static LLT TypeObjects[] = {
// CHECK-NEXT: LLT::scalar(32),
// CHECK-NEXT: };
+// CHECK-LABEL: // Feature bitsets.
+// CHECK-NEXT: enum {
+// CHECK-NEXT: GIFBS_Invalid,
+// CHECK-NEXT: GIFBS_HasA,
+// CHECK-NEXT: GIFBS_HasA_HasB_HasC,
+// CHECK-NEXT: }
+// CHECK-NEXT: const static PredicateBitset FeatureBitsets[] {
+// CHECK-NEXT: {}, // GIFBS_Invalid
+// CHECK-NEXT: {Feature_HasABit, },
+// CHECK-NEXT: {Feature_HasABit, Feature_HasBBit, Feature_HasCBit, },
+// CHECK-NEXT: };
+
+// CHECK-LABEL: // ComplexPattern predicates.
+// CHECK-NEXT: enum {
+// CHECK-NEXT: GICP_Invalid,
+// CHECK-NEXT: GICP_gi_complex,
+// CHECK-NEXT: };
+
// CHECK: bool MyTargetInstructionSelector::selectImpl(MachineInstr &I) const {
// CHECK-NEXT: MachineFunction &MF = *I.getParent()->getParent();
// CHECK-NEXT: MachineRegisterInfo &MRI = MF.getRegInfo();
for (const auto &Ty : LLTOperandMatcher::KnownTypes)
TypeObjects.push_back(Ty);
std::sort(TypeObjects.begin(), TypeObjects.end());
- OS << "enum {\n";
+ OS << "// LLT Objects.\n"
+ << "enum {\n";
for (const auto &TypeObject : TypeObjects) {
OS << " ";
TypeObject.emitCxxEnumValue(OS);
FeatureBitsets.erase(
std::unique(FeatureBitsets.begin(), FeatureBitsets.end()),
FeatureBitsets.end());
- OS << "enum {\n"
+ OS << "// Feature bitsets.\n"
+ << "enum {\n"
<< " GIFBS_Invalid,\n";
for (const auto &FeatureBitset : FeatureBitsets) {
if (FeatureBitset.empty())
OS << "};\n\n";
// Emit complex predicate table and an enum to reference them with.
- OS << "enum {\n"
+ OS << "// ComplexPattern predicates.\n"
+ << "enum {\n"
<< " GICP_Invalid,\n";
for (const auto &Record : ComplexPredicates)
OS << " GICP_" << Record->getName() << ",\n";