diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h --- a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h @@ -20,11 +20,27 @@ namespace llvm { namespace MIPatternMatch { +/// Match a structured pattern of MachineInstrs +/// +/// \param R The vreg to start matching from. The pattern will begin matching +/// the instruction that defined this vreg. +/// \param MRI The MachineRegisterInfo object for the current target +/// \param Pattern The pattern to match consisting of m_ICst(), m_OneUse(), and +/// similar nodes. Note: The generated documentation is linking +/// to an unrelated class with a coinciding name. template bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P) { return P.match(MRI, R); } +/// Match a structured pattern of MachineInstrs +/// +/// \param MI The MachineInstr to start matching from. It's assumed that +/// matching is intended to start from one of the vregs it defines. +/// \param MRI The MachineRegisterInfo object for the current target +/// \param Pattern The pattern to match consisting of m_ICst(), m_OneUse(), and +/// similar nodes. Note: The generated documentation is linking +/// to an unrelated class with a coinciding name. template bool mi_match(MachineInstr &MI, const MachineRegisterInfo &MRI, Pattern &&P) { return P.match(MRI, &MI);