futhark-0.18.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.Analysis.CallGraph

Description

This module exports functionality for generating a call graph of an Futhark program.

Synopsis

Documentation

data CallGraph Source #

The call graph is a mapping from a function name, i.e., the caller, to a set of the names of functions called *directly* (not transitively!) by the function.

We keep track separately of the functions called by constants.

buildCallGraph :: Prog SOACS -> CallGraph Source #

buildCallGraph prog build the program's call graph.

isFunInCallGraph :: Name -> CallGraph -> Bool Source #

Is the given function known to the call graph?

calls :: Name -> Name -> CallGraph -> Bool Source #

Does the first function call the second?

calledByConsts :: Name -> CallGraph -> Bool Source #

Is the function called in any of the constants?

allCalledBy :: Name -> CallGraph -> Set Name Source #

All functions called by this function.

findNoninlined :: Prog SOACS -> Set Name Source #

The set of all functions that are called noinline somewhere, or have a noinline attribute on their definition.