[TableGen][NFC] Add maybe_unused to MRI (#87044)

This suppresses warning `unused variable 'MRI' [-Wunused-variable]`
for those fusions that don't need `MRI`.
This commit is contained in:
Pengcheng Wang 2024-04-01 18:04:28 +08:00 committed by GitHub
parent 8827ff92b9
commit b342d87f89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,7 +108,8 @@ void MacroFusionPredicatorEmitter::emitMacroFusionImpl(
OS.indent(4) << "const TargetSubtargetInfo &STI,\n";
OS.indent(4) << "const MachineInstr *FirstMI,\n";
OS.indent(4) << "const MachineInstr &SecondMI) {\n";
OS.indent(2) << "auto &MRI = SecondMI.getMF()->getRegInfo();\n";
OS.indent(2)
<< "[[maybe_unused]] auto &MRI = SecondMI.getMF()->getRegInfo();\n";
emitPredicates(Predicates, IsCommutable, PE, OS);