From: Ahmed Bougacha Date: Sat, 4 Feb 2017 00:47:10 +0000 (+0000) Subject: [GlobalISel] Add a few comments to the tablegen backend. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15b47b4b5e908f5fa7a186d84f4ed0f5325da86d;p=llvm [GlobalISel] Add a few comments to the tablegen backend. NFC. Based on a review of D29478 by Kristof Beyls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294077 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/GlobalISelEmitter.cpp b/utils/TableGen/GlobalISelEmitter.cpp index 45567b23787..f6bcca81484 100644 --- a/utils/TableGen/GlobalISelEmitter.cpp +++ b/utils/TableGen/GlobalISelEmitter.cpp @@ -285,6 +285,11 @@ public: //===- Actions ------------------------------------------------------------===// +/// An action taken when all Matcher predicates succeeded for a parent rule. +/// +/// Typical actions include: +/// * Changing the opcode of an instruction. +/// * Adding an operand to an instruction. class MatchAction { public: virtual ~MatchAction() {} @@ -304,6 +309,8 @@ public: } }; +/// Generates code to set the opcode (really, the MCInstrDesc) of a matched +/// instruction to a given Instruction. class MutateOpcodeAction : public MatchAction { private: const CodeGenInstruction *I; @@ -318,12 +325,15 @@ public: }; /// Generates code to check that a match rule matches. -/// -/// This currently supports a single match position but could be extended to -/// support multiple positions to support div/rem fusion or load-multiple -/// instructions. class RuleMatcher { + /// A list of matchers that all need to succeed for the current rule to match. + /// FIXME: This currently supports a single match position but could be + /// extended to support multiple positions to support div/rem fusion or + /// load-multiple instructions. std::vector> Matchers; + + /// A list of actions that need to be taken when all predicates in this rule + /// have succeeded. std::vector> Actions; public: