LLVM: lib/Transforms/IPO/LowerTypeTests.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "lowertypetests"
Functions
STATISTIC (ByteArraySizeBits, "Byte array size in bits")
STATISTIC (ByteArraySizeBytes, "Byte array size in bytes")
STATISTIC (NumByteArraysCreated, "Number of byte arrays created")
STATISTIC (NumTypeTestCallsLowered, "Number of type test calls lowered")
STATISTIC (NumTypeIdDisjointSets, "Number of disjoint sets of type identifiers")
static BitSetInfo buildBitSet (ArrayRef< uint64_t > Offsets)
Build a bit set for list of offsets.
static Value * createMaskedBitTest (IRBuilder<> &B, Value *Bits, Value *BitOffset)
Build a test that bit BitOffset mod sizeof(Bits)*8 is set in Bits.
static bool isKnownTypeIdMember (Metadata *TypeId, const DataLayout &DL, Value *V, uint64_t COffset)
static auto buildBitSets (ArrayRef< Metadata * > TypeIds, const DenseMap< GlobalTypeMember *, uint64_t > &GlobalLayout)
static bool isThumbFunction (Function *F, Triple::ArchType ModuleArch)
static bool isDirectCall (Use &U)
static void dropTypeTests (Module &M, Function &TypeTestFunc, bool ShouldDropAll)
Variables
static cl::opt< bool > AvoidReuse ("lowertypetests-avoid-reuse", cl::desc("Try to avoid reuse of byte array addresses using aliases"), cl::Hidden, cl::init(true))
static cl::opt< PassSummaryAction > ClSummaryAction ("lowertypetests-summary-action", cl::desc("What to do with the summary when running this pass"), cl::values(clEnumValN(PassSummaryAction::None, "none", "Do nothing"), clEnumValN(PassSummaryAction::Import, "import", "Import typeid resolutions from summary and globals"), clEnumValN(PassSummaryAction::Export, "export", "Export typeid resolutions to summary and globals")), cl::Hidden)
static cl::opt< std::string > ClReadSummary ("lowertypetests-read-summary", cl::desc("Read summary from given YAML file before running pass"), cl::Hidden)
static cl::opt< std::string > ClWriteSummary ("lowertypetests-write-summary", cl::desc("Write summary to given YAML file after running pass"), cl::Hidden)
static cl::opt< DropTestKind > ClDropTypeTests ("lowertypetests-drop-type-tests", cl::desc("Simply drop type test sequences"), cl::values(clEnumValN(DropTestKind::None, "none", "Do not drop any type tests"), clEnumValN(DropTestKind::Assume, "assume", "Drop type test assume sequences"), clEnumValN(DropTestKind::All, "all", "Drop all type test sequences")), cl::Hidden, cl::init(DropTestKind::None))
static const unsigned kX86JumpTableEntrySize = 8
static const unsigned kX86IBTJumpTableEntrySize = 16
static const unsigned kARMJumpTableEntrySize = 4
static const unsigned kARMBTIJumpTableEntrySize = 8
static const unsigned kARMv6MJumpTableEntrySize = 16
static const unsigned kRISCVJumpTableEntrySize = 8
static const unsigned kLOONGARCH64JumpTableEntrySize = 8

DEBUG_TYPE

#define DEBUG_TYPE "lowertypetests"

buildBitSet()

buildBitSets()

Definition at line 1151 of file LowerTypeTests.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), buildBitSet(), llvm::cast(), llvm::dbgs(), llvm::dyn_cast(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), LLVM_DEBUG, llvm::Offset, llvm::SmallVectorImpl< T >::reserve(), and llvm::ArrayRef< T >::size().

createMaskedBitTest()

dropTypeTests()

Definition at line 1998 of file LowerTypeTests.cpp.

References llvm::all_of(), assert(), llvm::lowertypetests::Assume, llvm::cast(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::ConstantInt::getTrue(), llvm::make_early_inc_range(), llvm::Value::replaceAllUsesWith(), llvm::Value::use_empty(), llvm::Value::users(), and llvm::Value::uses().

isDirectCall()

bool isDirectCall ( Use & U) static

isKnownTypeIdMember()

isThumbFunction()

STATISTIC() [1/5]

STATISTIC ( ByteArraySizeBits ,
"Byte array size in bits" )

STATISTIC() [2/5]

STATISTIC ( ByteArraySizeBytes ,
"Byte array size in bytes" )

STATISTIC() [3/5]

STATISTIC ( NumByteArraysCreated ,
"Number of byte arrays created" )

STATISTIC() [4/5]

STATISTIC ( NumTypeIdDisjointSets ,
"Number of disjoint sets of type identifiers" )

STATISTIC() [5/5]

STATISTIC ( NumTypeTestCallsLowered ,
"Number of type test calls lowered" )

AvoidReuse

cl::opt< bool > AvoidReuse("lowertypetests-avoid-reuse", cl::desc("Try to avoid reuse of byte array addresses using aliases"), cl::Hidden, cl::init(true)) ( "lowertypetests-avoid-reuse" , cl::desc("Try to avoid reuse of byte array addresses using aliases") , cl::Hidden , cl::init(true) ) static

ClDropTypeTests

cl::opt< DropTestKind > ClDropTypeTests("lowertypetests-drop-type-tests", cl::desc("Simply drop type test sequences"), cl::values(clEnumValN(DropTestKind::None, "none", "Do not drop any type tests"), clEnumValN(DropTestKind::Assume, "assume", "Drop type test assume sequences"), clEnumValN(DropTestKind::All, "all", "Drop all type test sequences")), cl::Hidden, cl::init(DropTestKind::None)) ( "lowertypetests-drop-type-tests" , cl::desc("Simply drop type test sequences") , cl::values(clEnumValN(DropTestKind::None, "none", "Do not drop any type tests"), clEnumValN(DropTestKind::Assume, "assume", "Drop type test assume sequences"), clEnumValN(DropTestKind::All, "all", "Drop all type test sequences")) , cl::Hidden , cl::init(DropTestKind::None) ) static

ClReadSummary

cl::opt< std::string > ClReadSummary("lowertypetests-read-summary", cl::desc("Read summary from given YAML file before running pass"), cl::Hidden) ( "lowertypetests-read-summary" , cl::desc("Read summary from given YAML file before running pass") , cl::Hidden ) static

ClSummaryAction

cl::opt< PassSummaryAction > ClSummaryAction("lowertypetests-summary-action", cl::desc("What to do with the summary when running this pass"), cl::values(clEnumValN(PassSummaryAction::None, "none", "Do nothing"), clEnumValN(PassSummaryAction::Import, "import", "Import typeid resolutions from summary and globals"), clEnumValN(PassSummaryAction::Export, "export", "Export typeid resolutions to summary and globals")), cl::Hidden) ( "lowertypetests-summary-action" , cl::desc("What to do with the summary when running this pass") , cl::values(clEnumValN(PassSummaryAction::None, "none", "Do nothing"), clEnumValN(PassSummaryAction::Import, "import", "Import typeid resolutions from summary and globals"), clEnumValN(PassSummaryAction::Export, "export", "Export typeid resolutions to summary and globals")) , cl::Hidden ) static

ClWriteSummary

cl::opt< std::string > ClWriteSummary("lowertypetests-write-summary", cl::desc("Write summary to given YAML file after running pass"), cl::Hidden) ( "lowertypetests-write-summary" , cl::desc("Write summary to given YAML file after running pass") , cl::Hidden ) static

kARMBTIJumpTableEntrySize

kARMJumpTableEntrySize

kARMv6MJumpTableEntrySize

kLOONGARCH64JumpTableEntrySize

kRISCVJumpTableEntrySize

kX86IBTJumpTableEntrySize

kX86JumpTableEntrySize