LLVM  8.0.1
Macros | Functions | Variables
XCoreLowerThreadLocal.cpp File Reference

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"
Include dependency graph for XCoreLowerThreadLocal.cpp:

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 ArrayTypecreateLoweredType (Type *OriginalType)
 
static ConstantcreateLoweredInitializer (ArrayType *NewType, Constant *OriginalInitializer)
 
static InstructioncreateReplacementInstr (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< unsignedMaxThreads ("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))
 

Detailed Description

This file contains a pass that lowers thread local variables on the XCore.

Definition in file XCoreLowerThreadLocal.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "xcore-lower-thread-local"

Definition at line 29 of file XCoreLowerThreadLocal.cpp.

Function Documentation

◆ createLoweredInitializer()

static Constant* createLoweredInitializer ( ArrayType NewType,
Constant OriginalInitializer 
)
static

Definition at line 69 of file XCoreLowerThreadLocal.cpp.

References llvm::ConstantArray::get(), and MaxThreads.

Referenced by isZeroLengthArray().

◆ createLoweredType()

static ArrayType* createLoweredType ( Type OriginalType)
static

Definition at line 64 of file XCoreLowerThreadLocal.cpp.

References llvm::ArrayType::get(), and MaxThreads.

Referenced by isZeroLengthArray().

◆ createReplacementInstr()

static Instruction* createReplacementInstr ( ConstantExpr CE,
Instruction Instr 
)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( XCoreLowerThreadLocal  ,
"xcore-lower-thread-local"  ,
"Lower thread local variables"  ,
false  ,
false   
)

Definition at line 57 of file XCoreLowerThreadLocal.cpp.

◆ isZeroLengthArray()

static bool isZeroLengthArray ( Type Ty)
static

◆ replaceConstantExprOp()

static bool replaceConstantExprOp ( ConstantExpr CE,
Pass P 
)
static

◆ rewriteNonInstructionUses()

static bool rewriteNonInstructionUses ( GlobalVariable GV,
Pass P 
)
static

Variable Documentation

◆ MaxThreads

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))
static