[PATCH] D114898: [mipatternmatch] Document the mi_match() parameters

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 11:46:45 PST 2021


dsanders created this revision.
dsanders added a reviewer: bogner.
dsanders requested review of this revision.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114898

Files:
  llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h


Index: llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
===================================================================
--- llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
+++ 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 <typename Reg, typename Pattern>
 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 <typename Pattern>
 bool mi_match(MachineInstr &MI, const MachineRegisterInfo &MRI, Pattern &&P) {
   return P.match(MRI, &MI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114898.391100.patch
Type: text/x-patch
Size: 1583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211201/261cf675/attachment.bin>


More information about the llvm-commits mailing list