Class AnnotateInternalFunctionsPass

class AnnotateInternalFunctionsPass : public CallGraphSCCPass

Annotates internal functions with function attributes designating the function as one which does not modify memory, does not throw, does not synchronize state with other functions/parts of the program, and is guaranteed to return. This allows the LLVM optimizer to more aggressively remove / reorder these functions and is particularly important for dead code elimination.

Public Functions

AnnotateInternalFunctionsPass()
bool runOnSCC(llvm::CallGraphSCC &SCC)
llvm::StringRef getPassName() const

Public Static Attributes

char ID = 0

Private Static Functions

static bool isInternalStatelessFunction(const llvm::StringRef &func_name)
static bool isInternalMathFunction(const llvm::StringRef &func_name)

Private Static Attributes

const std::set<std::string> extension_functions = std::set<std::string>{"point_coord_array_is_null", , , , , , , , , , , , , , , , , , , , , , , , , }
const std::set<std::string> math_builtins = std::set<std::string>{"Acos", , , , , , , , , , , , , , , , , , , , , , }