Revision 1644e64926892ded4bb05e7f457783ec2639b96a authored by Fangrui Song on 07 September 2022, 18:28:08 UTC, committed by GitHub on 07 September 2022, 18:28:08 UTC
https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6
renamed ModuleAddressSanitizerPass to AddressSanitizerPass.
https://github.com/llvm/llvm-project/commit/4c18670776cd6ac31099a455b2b22b38b0408006
renamed ModuleSanitizerCoveragePass.
1 parent cbe2e63
Raw File
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)) ||
        rewrite(!(!x && y), x || !y) ||
        rewrite(!(!x || y), x && !y) ||
        rewrite(!(x && !y), !x || y) ||
        rewrite(!(x || !y), !x && y) ||
        false) {
        return mutate(rewrite.result, bounds);
    }

    if (a.same_as(op->a)) {
        return op;
    } else {
        return Not::make(a);
    }
}

}  // namespace Internal
}  // namespace Halide
back to top