LLVM 20.0.0git
|
Eliminate dead arguments (and return values) from functions. More...
#include "llvm/Transforms/IPO/DeadArgumentElimination.h"
Classes | |
struct | RetOrArg |
Struct that represents (part of) either a return value or a function argument. More... | |
Public Types | |
enum | Liveness { Live , MaybeLive } |
During our initial pass over the program, we determine that things are either alive or maybe alive. More... | |
using | UseMap = std::multimap< RetOrArg, RetOrArg > |
using | LiveSet = std::set< RetOrArg > |
using | LiveFuncSet = std::set< const Function * > |
using | UseVector = SmallVector< RetOrArg, 5 > |
Public Member Functions | |
DeadArgumentEliminationPass (bool ShouldHackArguments=false) | |
PreservedAnalyses | run (Module &M, ModuleAnalysisManager &) |
RetOrArg | createRet (const Function *F, unsigned Idx) |
Convenience wrapper. | |
RetOrArg | createArg (const Function *F, unsigned Idx) |
Convenience wrapper. | |
![]() | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Public Attributes | |
UseMap | Uses |
This maps a return value or argument to any MaybeLive return values or arguments it uses. | |
LiveSet | LiveValues |
This set contains all values that have been determined to be live. | |
LiveFuncSet | LiveFunctions |
This set contains all values that are cannot be changed in any way. | |
bool | ShouldHackArguments = false |
This allows this pass to do double-duty as the dead arg hacking pass (used only by bugpoint). | |
Additional Inherited Members | |
![]() | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
Eliminate dead arguments (and return values) from functions.
Definition at line 38 of file DeadArgumentElimination.h.
using llvm::DeadArgumentEliminationPass::LiveFuncSet = std::set<const Function *> |
Definition at line 109 of file DeadArgumentElimination.h.
using llvm::DeadArgumentEliminationPass::LiveSet = std::set<RetOrArg> |
Definition at line 108 of file DeadArgumentElimination.h.
using llvm::DeadArgumentEliminationPass::UseMap = std::multimap<RetOrArg, RetOrArg> |
Definition at line 90 of file DeadArgumentElimination.h.
Definition at line 117 of file DeadArgumentElimination.h.
During our initial pass over the program, we determine that things are either alive or maybe alive.
We don't mark anything explicitly dead (even if we know they are), since anything not alive with no registered uses (in Uses) will never be marked alive and will thus become dead in the end.
Enumerator | |
---|---|
Live | |
MaybeLive |
Definition at line 73 of file DeadArgumentElimination.h.
|
inline |
Definition at line 75 of file DeadArgumentElimination.h.
Convenience wrapper.
Definition at line 86 of file DeadArgumentElimination.h.
Referenced by values().
Convenience wrapper.
Definition at line 81 of file DeadArgumentElimination.h.
Referenced by values().
PreservedAnalyses DeadArgumentEliminationPass::run | ( | Module & | M, |
ModuleAnalysisManager & | |||
) |
Definition at line 1117 of file DeadArgumentElimination.cpp.
References llvm::PreservedAnalyses::all(), llvm::dbgs(), F, LLVM_DEBUG, llvm::make_early_inc_range(), and llvm::PreservedAnalyses::none().
LiveFuncSet llvm::DeadArgumentEliminationPass::LiveFunctions |
This set contains all values that are cannot be changed in any way.
Definition at line 115 of file DeadArgumentElimination.h.
Referenced by values().
LiveSet llvm::DeadArgumentEliminationPass::LiveValues |
This set contains all values that have been determined to be live.
Definition at line 112 of file DeadArgumentElimination.h.
Referenced by value().
bool llvm::DeadArgumentEliminationPass::ShouldHackArguments = false |
This allows this pass to do double-duty as the dead arg hacking pass (used only by bugpoint).
Definition at line 121 of file DeadArgumentElimination.h.
UseMap llvm::DeadArgumentEliminationPass::Uses |
This maps a return value or argument to any MaybeLive return values or arguments it uses.
This allows the MaybeLive values to be marked live when any of its users is marked live. For example (indices are left out for clarity):
Definition at line 106 of file DeadArgumentElimination.h.
Referenced by uses().