https://github.com/halide/Halide
Raw File
Tip revision: f3b548f4754d44434f3f94689077d27b45b607fe authored by Andrew Adams on 01 September 2023, 20:43:19 UTC
Skip onnx app on mac
Tip revision: f3b548f
DistributeShifts.h
#ifndef HALIDE_DISTRIBUTE_SHIFTS_H
#define HALIDE_DISTRIBUTE_SHIFTS_H

/** \file
 * A tool to distribute shifts as multiplies, useful for some backends. (e.g. ARM, HVX).
 */

#include "IR.h"

namespace Halide {
namespace Internal {

// Distributes shifts as multiplies. If `multiply_adds` is set,
// then only distributes the patterns `a + widening_shl(b, c)` /
// `a - widening_shl(b, c)` and `a + b << c` / `a - b << c`, to
// produce `a (+/-) widening_mul(b, 1 << c)` and `a (+/-) b * (1 << c)`,
// respectively
Stmt distribute_shifts(const Stmt &stmt, bool multiply_adds);

}  // namespace Internal
}  // namespace Halide

#endif
back to top