LLVM
8.0.1
|
This file contains a pass that lowers thread local variables on the XCore. More...
#include "XCore.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "xcore-lower-thread-local" |
Functions | |
INITIALIZE_PASS (XCoreLowerThreadLocal, "xcore-lower-thread-local", "Lower thread local variables", false, false) ModulePass *llvm | |
static ArrayType * | createLoweredType (Type *OriginalType) |
static Constant * | createLoweredInitializer (ArrayType *NewType, Constant *OriginalInitializer) |
static Instruction * | createReplacementInstr (ConstantExpr *CE, Instruction *Instr) |
static bool | replaceConstantExprOp (ConstantExpr *CE, Pass *P) |
static bool | rewriteNonInstructionUses (GlobalVariable *GV, Pass *P) |
static bool | isZeroLengthArray (Type *Ty) |
Variables | |
static cl::opt< unsigned > | MaxThreads ("xcore-max-threads", cl::Optional, cl::desc("Maximum number of threads (for emulation thread-local storage)"), cl::Hidden, cl::value_desc("number"), cl::init(8)) |
This file contains a pass that lowers thread local variables on the XCore.
Definition in file XCoreLowerThreadLocal.cpp.
#define DEBUG_TYPE "xcore-lower-thread-local" |
Definition at line 29 of file XCoreLowerThreadLocal.cpp.
|
static |
Definition at line 69 of file XCoreLowerThreadLocal.cpp.
References llvm::ConstantArray::get(), and MaxThreads.
Referenced by isZeroLengthArray().
Definition at line 64 of file XCoreLowerThreadLocal.cpp.
References llvm::ArrayType::get(), and MaxThreads.
Referenced by isZeroLengthArray().
|
static |
Definition at line 78 of file XCoreLowerThreadLocal.cpp.
References llvm::MCID::Add, llvm::IRBuilder< T, Inserter >::CreateBinOp(), llvm::IRBuilder< T, Inserter >::CreateCast(), llvm::IRBuilder< T, Inserter >::CreateInBoundsGEP(), llvm::dyn_cast(), llvm::Value::getName(), llvm::ConstantExpr::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm_unreachable, llvm::User::op_begin(), and llvm::User::op_end().
Referenced by replaceConstantExprOp().
INITIALIZE_PASS | ( | XCoreLowerThreadLocal | , |
"xcore-lower-thread-local" | , | ||
"Lower thread local variables" | , | ||
false | , | ||
false | |||
) |
Definition at line 57 of file XCoreLowerThreadLocal.cpp.
Definition at line 175 of file XCoreLowerThreadLocal.cpp.
References createLoweredInitializer(), createLoweredType(), llvm::dyn_cast(), E, llvm::GlobalVariable::eraseFromParent(), llvm::PointerType::getAddressSpace(), llvm::Intrinsic::getDeclaration(), llvm::GlobalVariable::getInitializer(), llvm::GlobalValue::getLinkage(), llvm::SequentialType::getNumElements(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getType(), llvm::GlobalValue::getValueType(), llvm::Module::globals(), llvm::GlobalVariable::hasInitializer(), I, llvm::GlobalVariable::isConstant(), llvm::GlobalVariable::isExternallyInitialized(), llvm::Type::isSized(), llvm::GlobalValue::isThreadLocal(), llvm::GlobalValue::NotThreadLocal, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::User::replaceUsesOfWith(), rewriteNonInstructionUses(), llvm::SmallVectorBase::size(), llvm::Value::takeName(), llvm::Value::user_begin(), llvm::Value::user_end(), Users, and llvm::Intrinsic::xcore_getid.
|
static |
Definition at line 129 of file XCoreLowerThreadLocal.cpp.
References createReplacementInstr(), llvm::Constant::destroyConstant(), llvm::dyn_cast(), E, llvm::Instruction::getNumSuccessors(), llvm::BasicBlock::getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::hasNUsesOrMore(), I, llvm::sort(), llvm::SplitEdge(), llvm::Value::user_begin(), and llvm::Value::user_end().
Referenced by rewriteNonInstructionUses().
|
static |
Definition at line 161 of file XCoreLowerThreadLocal.cpp.
References llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), replaceConstantExprOp(), and llvm::Value::users().
Referenced by isZeroLengthArray().
|
static |
Referenced by createLoweredInitializer(), and createLoweredType().