Skip to content

Commit

Permalink
Merge branch 'kgnk_bounds_visit_compare' of https://github.com/kgnk/H…
Browse files Browse the repository at this point in the history
…alide into kgnk-kgnk_bounds_visit_compare
  • Loading branch information
abadams committed Jul 12, 2017
2 parents ad7aabd + f3253ce commit 8521fe8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Bounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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());
}
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8521fe8

Please sign in to comment.