Anonymous View
LLVM 23.0.0git
DeadArgumentElimination.cpp File Reference

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")
static unsigned numRetVals (const Function *F)
 Convenience function that returns the number of return values.
static TypegetRetComponentType (const Function *F, unsigned Idx)
 Returns the sub-type a function will return at a given Idx.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "deadargelim"

Definition at line 56 of file DeadArgumentElimination.cpp.

Function Documentation

◆ getRetComponentType()

Type * getRetComponentType ( const Function * F,
unsigned Idx )
static

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 321 of file DeadArgumentElimination.cpp.

References assert(), llvm::dyn_cast(), F, and llvm::Type::isVoidTy().

◆ numRetVals()

unsigned numRetVals ( const Function * F)
static

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 307 of file DeadArgumentElimination.cpp.

References llvm::dyn_cast(), F, and llvm::Type::isVoidTy().

◆ STATISTIC() [1/3]

STATISTIC ( NumArgumentsEliminated ,
"Number of unread args removed"  )

◆ STATISTIC() [2/3]

STATISTIC ( NumArgumentsReplacedWithPoison ,
"Number of unread args replaced with poison"  )

◆ STATISTIC() [3/3]

STATISTIC ( NumRetValsEliminated ,
"Number of unused return values removed"  )