https://github.com/halide/Halide
Raw File
Tip revision: 8b7345672227597dd5c8ce7c3cedd7bd11cfd6d4 authored by Patricia Adriana Suriana on 22 September 2018, 03:09:39 UTC
Merge branch 'master' of https://github.com/halide/Halide into perform_inline_with_order
Tip revision: 8b73456
PurifyIndexMath.h
#ifndef HALIDE_PURIFY_INDEX_MATH_H
#define HALIDE_PURIFY_INDEX_MATH_H

/** \file
 * Removes side-effects in integer math.
 */

#include "IR.h"

namespace Halide {
namespace Internal {

/** Bounds inference and related stages can lift integer bounds
 * expressions out of if statements that guard against those integer
 * expressions doing side-effecty things like dividing or modding by
 * zero. In those cases, if the lowering passes are functional, the
 * value resulting from the division or mod is evaluated but not
 * used. This mutator rewrites divs and mods in such expressions to
 * fail silently (evaluate to undef) when the denominator is zero.
 */
Expr purify_index_math(Expr);

}
}

#endif
back to top