Parenthesize match expression to avoid operator precedence issues

PiperOrigin-RevId: 255435454
This commit is contained in:
MLIR Team 2019-06-27 10:56:37 -07:00 committed by A. Unique TensorFlower
parent bda669beea
commit 7b5f49af76
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ def : Pattern<(OpA:$res_a $operand, $attr),
// CHECK: s.operand = op0->getOperand(0);
// CHECK: attr = op0->getAttrOfType<IntegerAttr>("attr");
// CHECK: s.attr = attr;
// CHECK: if (!(s.res_a->hasOneUse())) return matchFailure();
// CHECK: if (!((s.res_a->hasOneUse()))) return matchFailure();
// Test bound results in result pattern
// ---

View File

@ -429,7 +429,7 @@ void PatternEmitter::emitMatchMethod(DagNode tree) {
auto &entities = appliedConstraint.entities;
auto condition = constraint.getConditionTemplate();
auto cmd = "if (!{0}) return matchFailure();\n";
auto cmd = "if (!({0})) return matchFailure();\n";
if (isa<TypeConstraint>(constraint)) {
auto self = formatv("(*{0}->result_type_begin())",