From f3253ce50bcb201c2569fe1fd5ee670aab375205 Mon Sep 17 00:00:00 2001 From: Khouri Giordano Date: Wed, 12 Jul 2017 11:26:18 -0400 Subject: [PATCH] fix bound type mismatch for compares and document other fallthrough cases --- src/Bounds.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Bounds.cpp b/src/Bounds.cpp index 18358caa5883..31a63522d3bc 100644 --- a/src/Bounds.cpp +++ b/src/Bounds.cpp @@ -435,6 +435,7 @@ class Bounds : public IRVisitor { op->b.accept(this); if (!interval.is_bounded()) { + // Uses interval produced by op->b which might be half bound. return; } Interval b = interval; @@ -503,12 +504,14 @@ class Bounds : public IRVisitor { void visit_compare(const Expr &a_expr, const Expr &b_expr) { a_expr.accept(this); if (!interval.is_bounded()) { + bounds_of_type(Bool()); return; } Interval a = interval; b_expr.accept(this); if (!interval.is_bounded()) { + bounds_of_type(Bool()); return; } Interval b = interval; @@ -520,7 +523,7 @@ class Bounds : public IRVisitor { } else if (can_prove(always_false)) { interval = Interval::single_point(const_false()); } else { - bounds_of_type(Bool(a_expr.type().lanes())); + bounds_of_type(Bool()); } } @@ -563,12 +566,14 @@ class Bounds : public IRVisitor { void visit(const Select *op) { op->true_value.accept(this); if (!interval.is_bounded()) { + // Uses interval produced by op->true_value which might be half bound. return; } Interval a = interval; op->false_value.accept(this); if (!interval.is_bounded()) { + // Uses interval produced by op->false_value which might be half bound. return; } Interval b = interval;