35 if (isa<GlobalValue>(C))
40 if (
const Constant *CU = dyn_cast<Constant>(*UI)) {
53 if (
const ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) {
58 if (!isa<PointerType>(CE->getType()))
63 }
else if (
const Instruction *
I = dyn_cast<Instruction>(U)) {
65 const Function *
F =
I->getParent()->getParent();
77 }
else if (
const StoreInst *SI = dyn_cast<StoreInst>(
I)) {
79 if (SI->getOperand(0) == V)
93 dyn_cast<GlobalVariable>(SI->getOperand(1))) {
94 Value *StoredVal = SI->getOperand(0);
96 if (
Constant *
C = dyn_cast<Constant>(StoredVal)) {
97 if (
C->isThreadDependent()) {
103 if (StoredVal == GV->getInitializer()) {
106 }
else if (isa<LoadInst>(StoredVal) &&
107 cast<LoadInst>(StoredVal)->getOperand(0) == GV) {
123 }
else if (isa<BitCastInst>(
I)) {
126 }
else if (isa<GetElementPtrInst>(
I)) {
129 }
else if (isa<SelectInst>(
I)) {
132 }
else if (
const PHINode *PN = dyn_cast<PHINode>(
I)) {
138 }
else if (isa<CmpInst>(
I)) {
141 if (MTI->isVolatile())
143 if (MTI->getArgOperand(0) == V)
145 if (MTI->getArgOperand(1) == V)
147 }
else if (
const MemSetInst *MSI = dyn_cast<MemSetInst>(
I)) {
148 assert(MSI->getArgOperand(0) == V &&
"Memset only takes one pointer!");
149 if (MSI->isVolatile())
159 }
else if (
const Constant *
C = dyn_cast<Constant>(U)) {
181 StoredOnceValue(0), AccessingFunction(0),
182 HasMultipleAccessingFunctions(
false), HasNonInstructionUser(
false),
static bool analyzeGlobalAux(const Value *V, GlobalStatus &GS, SmallPtrSet< const PHINode *, 16 > &PhiUsers)
const Function * AccessingFunction
bool HasMultipleAccessingFunctions
LoopInfoBase< BlockT, LoopT > * LI
StoredType
Keep track of what stores to the global look like.
bool HasNonInstructionUser
static AtomicOrdering strongerOrdering(AtomicOrdering X, AtomicOrdering Y)
* if(!EatIfPresent(lltok::kw_thread_local)) return false
LLVM Constant Representation.
static bool analyzeGlobal(const Value *V, GlobalStatus &GS)
bool isSafeToDestroyConstant(const Constant *C)
bool IsCompared
True if the global's address is used in a comparison.
AtomicOrdering Ordering
Set to the strongest atomic ordering requirement.
ImmutableCallSite - establish a view to a call site for examination.
LLVM Value Representation.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")