aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorjofrn <jofernau@amd.com>2024-04-25 13:42:48 -0700
committerGitHub <noreply@github.com>2024-04-25 16:42:48 -0400
commiteae7554d3f1fb1546c629a9a2ae0654b1001ab41 (patch)
tree66a412e2585e547fefe8923766ee6de72c51410f /llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
parent933f49248bfede6b22d516baa5cf80bdf85c3c61 (diff)
downloadllvm-eae7554d3f1fb1546c629a9a2ae0654b1001ab41.zip
llvm-eae7554d3f1fb1546c629a9a2ae0654b1001ab41.tar.gz
llvm-eae7554d3f1fb1546c629a9a2ae0654b1001ab41.tar.bz2
[TableGen] ShouldIgnore Pattern bit to disable DAG pattern imports during GISel (#88382)
Added GISelShouldIgnore property to class Pattern in TargetSelectionDAG.td; it's similar to FastISelShouldIgnore. This bit can be put on a record to avoid its pattern import within GlobalISelEmitter. This allows one to avoid the record's GISel .td implementation, .inc generation, and any skipped pattern warnings from -warn-on-skipped-patterns.
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 7a5d2be..88d353e 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -4246,7 +4246,7 @@ static TreePatternNodePtr PromoteXForms(TreePatternNodePtr N) {
void CodeGenDAGPatterns::ParseOnePattern(
Record *TheDef, TreePattern &Pattern, TreePattern &Result,
- const std::vector<Record *> &InstImpResults) {
+ const std::vector<Record *> &InstImpResults, bool ShouldIgnore) {
// Inline pattern fragments and expand multiple alternatives.
Pattern.InlinePatternFragments();
@@ -4332,7 +4332,7 @@ void CodeGenDAGPatterns::ParseOnePattern(
AddPatternToMatch(&Pattern,
PatternToMatch(TheDef, Preds, T, Temp.getOnlyTree(),
InstImpResults, Complexity,
- TheDef->getID()));
+ TheDef->getID(), ShouldIgnore));
}
} else {
// Show a message about a dropped pattern with some info to make it
@@ -4378,7 +4378,8 @@ void CodeGenDAGPatterns::ParsePatterns() {
FindPatternInputsAndOutputs(Pattern, Pattern.getTree(j), InstInputs,
InstResults, InstImpResults);
- ParseOnePattern(CurPattern, Pattern, Result, InstImpResults);
+ ParseOnePattern(CurPattern, Pattern, Result, InstImpResults,
+ CurPattern->getValueAsBit("GISelShouldIgnore"));
}
}
@@ -4407,10 +4408,10 @@ void CodeGenDAGPatterns::ExpandHwModeBasedTypes() {
return;
}
- PatternsToMatch.emplace_back(P.getSrcRecord(), P.getPredicates(),
- std::move(NewSrc), std::move(NewDst),
- P.getDstRegs(), P.getAddedComplexity(),
- Record::getNewUID(Records), Check);
+ PatternsToMatch.emplace_back(
+ P.getSrcRecord(), P.getPredicates(), std::move(NewSrc),
+ std::move(NewDst), P.getDstRegs(), P.getAddedComplexity(),
+ Record::getNewUID(Records), P.getGISelShouldIgnore(), Check);
};
for (PatternToMatch &P : Copy) {
@@ -4781,6 +4782,7 @@ void CodeGenDAGPatterns::GenerateVariants() {
Variant, PatternsToMatch[i].getDstPatternShared(),
PatternsToMatch[i].getDstRegs(),
PatternsToMatch[i].getAddedComplexity(), Record::getNewUID(Records),
+ PatternsToMatch[i].getGISelShouldIgnore(),
PatternsToMatch[i].getHwModeFeatures());
}