swh:1:snp:2c68c8bd649bf1bd2cf3bf7bd4f98d247b82b5dc
Raw File
Tip revision: 057a94251daf5cfac1c3a14a36a63d8a0413f5c0 authored by Pranav Bhandarkar on 24 October 2022, 20:13:06 UTC
Add tests for eliminate_interleaves
Tip revision: 057a942
FindCalls.h
#ifndef FIND_CALLS_H
#define FIND_CALLS_H

/** \file
 *
 * Defines analyses to extract the functions called a function.
 */

#include <map>
#include <string>
#include <vector>

#include "Expr.h"

namespace Halide {
namespace Internal {

class Function;

/** Construct a map from name to Function definition object for all Halide
 *  functions called directly in the definition of the Function f, including
 *  in update definitions, update index expressions, and RDom extents. This map
 *  _does not_ include the Function f, unless it is called recursively by
 *  itself.
 */
std::map<std::string, Function> find_direct_calls(const Function &f);

/** Construct a map from name to Function definition object for all Halide
 *  functions called directly in the definition of the Function f, or
 *  indirectly in those functions' definitions, recursively. This map always
 *  _includes_ the Function f.
 */
std::map<std::string, Function> find_transitive_calls(const Function &f);

/** Find all Functions transitively referenced by any Function in `funcs` and return
 * a map of them. */
std::map<std::string, Function> build_environment(const std::vector<Function> &funcs);

}  // namespace Internal
}  // namespace Halide

#endif
back to top