summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2017-02-04 00:47:10 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2017-02-04 00:47:10 +0000
commit56ca3a9ad9d935c83d0bd36e9b371d25298594b4 (patch)
tree8c4b6641a1a740cdf5fdfde44f56cbf70e3c4653 /llvm/utils
parent9aa4c108369fbd2f3a7ffe0c2a8668f22e9b26fc (diff)
downloadbcm5719-llvm-56ca3a9ad9d935c83d0bd36e9b371d25298594b4.tar.gz
bcm5719-llvm-56ca3a9ad9d935c83d0bd36e9b371d25298594b4.zip
[GlobalISel] Add a few comments to the tablegen backend. NFC.
Based on a review of D29478 by Kristof Beyls. llvm-svn: 294077
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/GlobalISelEmitter.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index 45567b23787..f6bcca81484 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/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<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:
OpenPOWER on IntegriCloud