LLVM  4.0.0
Macros | Typedefs | Functions | Variables
LowerTypeTests.cpp File Reference
#include "llvm/Transforms/IPO/LowerTypeTests.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSummaryIndexYAML.h"
#include "llvm/IR/Operator.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/TrailingObjects.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
Include dependency graph for LowerTypeTests.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lowertypetests"
 

Typedefs

using SummaryAction = LowerTypeTestsSummaryAction
 

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 ValuecreateMaskedBitTest (IRBuilder<> &B, Value *Bits, Value *BitOffset)
 Build a test that bit BitOffset mod sizeof(Bits)*8 is set in Bits. More...
 
static bool isKnownTypeIdMember (Metadata *TypeId, const DataLayout &DL, Value *V, uint64_t COffset)
 

Variables

static cl::opt< boolAvoidReuse ("lowertypetests-avoid-reuse", cl::desc("Try to avoid reuse of byte array addresses using aliases"), cl::Hidden, cl::init(true))
 
static cl::opt< SummaryActionClSummaryAction ("lowertypetests-summary-action", cl::desc("What to do with the summary when running this pass"), cl::values(clEnumValN(SummaryAction::None,"none","Do nothing"), clEnumValN(SummaryAction::Import,"import","Import typeid resolutions from summary and globals"), clEnumValN(SummaryAction::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 const unsigned kX86JumpTableEntrySize = 8
 
static const unsigned kARMJumpTableEntrySize = 4
 

Macro Definition Documentation

#define DEBUG_TYPE   "lowertypetests"

Definition at line 47 of file LowerTypeTests.cpp.

Typedef Documentation

Definition at line 45 of file LowerTypeTests.cpp.

Function Documentation

static Value* createMaskedBitTest ( IRBuilder<> &  B,
Value Bits,
Value BitOffset 
)
static

Build a test that bit BitOffset mod sizeof(Bits)*8 is set in Bits.

This pattern matches to the bt instruction on x86.

Definition at line 402 of file LowerTypeTests.cpp.

References llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateICmpNE(), llvm::IRBuilder< T, Inserter >::CreateShl(), llvm::IRBuilder< T, Inserter >::CreateZExtOrTrunc(), llvm::ConstantInt::get(), and llvm::Value::getType().

static bool isKnownTypeIdMember ( Metadata TypeId,
const DataLayout DL,
Value V,
uint64_t  COffset 
)
static
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"   
)

Variable Documentation

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<std::string> ClReadSummary("lowertypetests-read-summary", cl::desc("Read summary from given YAML file before running pass"), cl::Hidden)
static
cl::opt<SummaryAction> ClSummaryAction("lowertypetests-summary-action", cl::desc("What to do with the summary when running this pass"), cl::values(clEnumValN(SummaryAction::None,"none","Do nothing"),clEnumValN(SummaryAction::Import,"import","Import typeid resolutions from summary and globals"),clEnumValN(SummaryAction::Export,"export","Export typeid resolutions to summary and globals")), 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
const unsigned kARMJumpTableEntrySize = 4
static

Definition at line 773 of file LowerTypeTests.cpp.

const unsigned kX86JumpTableEntrySize = 8
static

Definition at line 772 of file LowerTypeTests.cpp.