diff options
Diffstat (limited to 'mlir/lib/TableGen/Predicate.cpp')
| -rw-r--r-- | mlir/lib/TableGen/Predicate.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp index f71dd0bd35f8..e5cfc074d09f 100644 --- a/mlir/lib/TableGen/Predicate.cpp +++ b/mlir/lib/TableGen/Predicate.cpp @@ -235,6 +235,16 @@ propagateGroundTruth(PredNode *node, return node; } + if (node->kind == PredCombinerKind::And && node->children.empty()) { + node->kind = PredCombinerKind::True; + return node; + } + + if (node->kind == PredCombinerKind::Or && node->children.empty()) { + node->kind = PredCombinerKind::False; + return node; + } + // Otherwise, look at child nodes. // Move child nodes into some local variable so that they can be optimized |
