19#ifndef LLVM_TRANSFORMS_IPO_DEADARGUMENTELIMINATION_H
20#define LLVM_TRANSFORMS_IPO_DEADARGUMENTELIMINATION_H
54 return std::tie(
F,
Idx,
IsArg) < std::tie(O.F, O.Idx, O.IsArg);
59 return F == O.F &&
Idx == O.Idx &&
IsArg == O.IsArg;
90 using UseMap = std::multimap<RetOrArg, RetOrArg>;
126 unsigned RetValNum = -1U);
136 bool removeDeadStuffFromFunction(
Function *
F);
138 bool removeDeadArgumentsFromCallers(
Function &
F);
139 void propagateVirtMustcallLiveness(
const Module &M);
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Machine Check Debug Module
This header defines various interfaces for pass management in LLVM.
SI optimize exec mask operations pre RA
This file defines the SmallVector class.
A container for analyses that lazily runs them and caches their results.
Eliminate dead arguments (and return values) from functions.
std::set< const Function * > LiveFuncSet
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
Liveness
During our initial pass over the program, we determine that things are either alive or maybe alive.
LiveSet LiveValues
This set contains all values that have been determined to be live.
RetOrArg createRet(const Function *F, unsigned Idx)
Convenience wrapper.
RetOrArg createArg(const Function *F, unsigned Idx)
Convenience wrapper.
bool ShouldHackArguments
This allows this pass to do double-duty as the dead arg hacking pass (used only by bugpoint).
std::multimap< RetOrArg, RetOrArg > UseMap
LiveFuncSet LiveFunctions
This set contains all values that are cannot be changed in any way.
DeadArgumentEliminationPass(bool ShouldHackArguments=false)
std::set< RetOrArg > LiveSet
UseMap Uses
This maps a return value or argument to any MaybeLive return values or arguments it uses.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
StringRef getName() const
Return a constant reference to the value's name.
NodeAddr< UseNode * > Use
This is an optimization pass for GlobalISel generic memory operations.
Struct that represents (part of) either a return value or a function argument.
bool operator==(const RetOrArg &O) const
Make RetOrArg comparable, so we can easily iterate the multimap.
bool operator<(const RetOrArg &O) const
Make RetOrArg comparable, so we can put it into a map.
std::string getDescription() const
RetOrArg(const Function *F, unsigned Idx, bool IsArg)
A CRTP mix-in to automatically provide informational APIs needed for passes.