summaryrefslogtreecommitdiff
path: root/mlir/lib/TableGen/Predicate.cpp
diff options
context:
space:
mode:
authorThurston Dang <thurston@google.com>2024-12-18 15:53:35 -0800
committerVitaly Buka <vitalybuka@google.com>2024-12-18 15:53:35 -0800
commit014a3c31ce7143093d8d1aafc6866e0c8a05a44b (patch)
tree09ed7378c44e3692dbe6b7ed283fdac33a16e14b /mlir/lib/TableGen/Predicate.cpp
parent97ff599fc6949dc2bac3af7eb3200ebd35990c5a (diff)
parent2691b964150c77a9e6967423383ad14a7693095e (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.nfcboundschecking-add-trapbb-local-variable
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'mlir/lib/TableGen/Predicate.cpp')
-rw-r--r--mlir/lib/TableGen/Predicate.cpp10
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