[PATCH] D142215: [MC] Define and use MCInstrDesc implicit_uses and implicit_defs. NFC.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 07:40:07 PST 2023


arsenm accepted this revision.
arsenm added inline comments.
This revision is now accepted and ready to land.
Herald added a subscriber: wdng.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/FastISel.cpp:1942
             ResultReg)
-        .addReg(II.getImplicitDefs()[0]);
   }
----------------
Just taking the first implicit def looks suspect to me. I'd expect something like MachineInstrBuilder::copyImplicitOps for an MCInstrDesc


================
Comment at: llvm/lib/MC/MCInstrDesc.cpp:33
 bool MCInstrDesc::hasImplicitDefOfPhysReg(unsigned Reg,
                                           const MCRegisterInfo *MRI) const {
+  for (MCPhysReg ImpDef : implicit_defs())
----------------
Using MRI when that's usually MachineRegisterInfo is a bit jarring. This API that doesn't work correctly if you don't pass it in is also just broken


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142215/new/

https://reviews.llvm.org/D142215



More information about the llvm-commits mailing list