[llvm] r294077 - [GlobalISel] Add a few comments to the tablegen backend. NFC.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 16:47:11 PST 2017


Author: ab
Date: Fri Feb  3 18:47:10 2017
New Revision: 294077

URL: http://llvm.org/viewvc/llvm-project?rev=294077&view=rev
Log:
[GlobalISel] Add a few comments to the tablegen backend. NFC.

Based on a review of D29478 by Kristof Beyls.

Modified:
    llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp

Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=294077&r1=294076&r2=294077&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Fri Feb  3 18:47:10 2017
@@ -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<std::unique_ptr<InstructionMatcher>> Matchers;
+
+  /// A list of actions that need to be taken when all predicates in this rule
+  /// have succeeded.
   std::vector<std::unique_ptr<MatchAction>> Actions;
 
 public:




More information about the llvm-commits mailing list