Revision 74f40fd72e69ae4e9e52c056306064907e07cfb6 authored by Andrew Adams on 03 March 2021, 20:26:03 UTC, committed by GitHub on 03 March 2021, 20:26:03 UTC
* Track time spent in malloc/free when profiling * Appease clang tidy * Remove unnecessary asserts
1 parent acebd50
Simplify_Not.cpp
#include "Simplify_Internal.h"
namespace Halide {
namespace Internal {
Expr Simplify::visit(const Not *op, ExprInfo *bounds) {
Expr a = mutate(op->a, nullptr);
auto rewrite = IRMatcher::rewriter(IRMatcher::not_op(a), op->type);
if (rewrite(!c0, fold(!c0)) ||
rewrite(!(x < y), y <= x) ||
rewrite(!(x <= y), y < x) ||
rewrite(!(x == y), x != y) ||
rewrite(!(x != y), x == y) ||
rewrite(!!x, x)) {
return rewrite.result;
}
if (rewrite(!broadcast(x, c0), broadcast(!x, c0)) ||
rewrite(!intrin(Call::likely, x), intrin(Call::likely, !x)) ||
rewrite(!intrin(Call::likely_if_innermost, x), intrin(Call::likely_if_innermost, !x))) {
return mutate(rewrite.result, bounds);
}
if (a.same_as(op->a)) {
return op;
} else {
return Not::make(a);
}
}
} // namespace Internal
} // namespace Halide
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...