}
if (MI.getParent() && MI.getParent()->getParent()) {
- const auto MF = MI.getMF();
- const auto &TM = static_cast<const RISCVTargetMachine &>(MF->getTarget());
- const MCSubtargetInfo &STI = *TM.getMCSubtargetInfo();
- const RISCVSubtarget &ST = MF->getSubtarget<RISCVSubtarget>();
- if (isCompressibleInst(MI, &ST, STI))
+ if (isCompressibleInst(MI, STI))
return 2;
}
return get(Opcode).getSize();
// an instruction is compressable:
//
// bool isCompressibleInst(const MachineInstr& MI,
-// const <TargetName>Subtarget *Subtarget,
-// const MCSubtargetInfo &STI);
+// const <TargetName>Subtarget &STI);
//
// The clients that include this auto-generated header file and
// invoke these functions can compress an instruction before emitting
FuncH.indent(27) << "const MCSubtargetInfo &STI) {\n";
} else if (EType == EmitterType::CheckCompress) {
FuncH << "static bool isCompressibleInst(const MachineInstr &MI,\n";
- FuncH.indent(31) << "const " << TargetName << "Subtarget *Subtarget,\n";
- FuncH.indent(31) << "const MCSubtargetInfo &STI) {\n";
+ FuncH.indent(31) << "const " << TargetName << "Subtarget &STI) {\n";
}
if (CompressPatterns.empty()) {
<< "MI.getOperand(" << OpIdx << ").isImm() &&\n";
CondStream.indent(6) << TargetName << "ValidateMachineOperand("
<< "MI.getOperand(" << OpIdx
- << "), Subtarget, " << Entry << ") &&\n";
+ << "), &STI, " << Entry << ") &&\n";
}
if (CompressOrUncompress)
CodeStream.indent(6)
CondStream.indent(6)
<< TargetName
<< "ValidateMachineOperand(MachineOperand::CreateImm("
- << DestOperandMap[OpNo].Data.Imm << "), SubTarget, " << Entry
+ << DestOperandMap[OpNo].Data.Imm << "), &STI, " << Entry
<< ") &&\n";
}
if (CompressOrUncompress)