|
LLVM 22.0.0git
|
#include "llvm/Transforms/IPO/DeadArgumentElimination.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/IR/Argument.h"#include "llvm/IR/AttributeMask.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DIBuilder.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/Module.h"#include "llvm/IR/NoFolder.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/Type.h"#include "llvm/IR/Use.h"#include "llvm/IR/User.h"#include "llvm/IR/Value.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/IPO.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include <cassert>#include <utility>#include <vector>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "deadargelim" |
Functions | |
| STATISTIC (NumArgumentsEliminated, "Number of unread args removed") | |
| STATISTIC (NumRetValsEliminated, "Number of unused return values removed") | |
| STATISTIC (NumArgumentsReplacedWithPoison, "Number of unread args replaced with poison") | |
| INITIALIZE_PASS (DAH, "deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)", false, false) ModulePass *llvm | |
| This pass removes arguments from functions which are not used by the body of the function. | |
| static unsigned | numRetVals (const Function *F) |
| Convenience function that returns the number of return values. | |
| static Type * | getRetComponentType (const Function *F, unsigned Idx) |
| Returns the sub-type a function will return at a given Idx. | |
| #define DEBUG_TYPE "deadargelim" |
Definition at line 56 of file DeadArgumentElimination.cpp.
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 Idx (i.e. only top-level structure is considered).
Definition at line 347 of file DeadArgumentElimination.cpp.
References assert(), llvm::dyn_cast(), F, and llvm::Type::isVoidTy().
| INITIALIZE_PASS | ( | DAH | , |
| "deadarghaX0r" | , | ||
| "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)" | , | ||
| false | , | ||
| false | ) |
This pass removes arguments from functions which are not used by the body of the function.
Definition at line 112 of file DeadArgumentElimination.cpp.
References llvm::createDeadArgEliminationPass().
Convenience function that returns the number of return values.
It returns 0 for void functions and 1 for functions not returning a struct. It returns the number of struct elements for functions returning a struct.
Definition at line 333 of file DeadArgumentElimination.cpp.
References llvm::dyn_cast(), F, and llvm::Type::isVoidTy().
| STATISTIC | ( | NumArgumentsEliminated | , |
| "Number of unread args removed" | ) |
| STATISTIC | ( | NumArgumentsReplacedWithPoison | , |
| "Number of unread args replaced with poison" | ) |
| STATISTIC | ( | NumRetValsEliminated | , |
| "Number of unused return values removed" | ) |