9#ifndef LLVM_TRANSFORMS_UTILS_GLOBALSTATUS_H
10#define LLVM_TRANSFORMS_UTILS_GLOBALSTATUS_H
Atomic ordering constants.
An instruction for storing to memory.
Value * getOperand(unsigned i) const
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
bool isSafeToDestroyConstant(const Constant *C)
It is safe to destroy a constant iff it is only used by constants itself.
AtomicOrdering
Atomic ordering for LLVM's memory model.
As we analyze each global or thread-local variable, keep track of some information about it.
bool IsLoaded
True if the global is ever loaded.
AtomicOrdering Ordering
Set to the strongest atomic ordering requirement.
bool HasMultipleAccessingFunctions
unsigned NumStores
Number of stores to the global.
const StoreInst * StoredOnceStore
If only one value (besides the initializer constant) is ever stored to this global,...
bool IsCompared
True if the global's address is used in a comparison.
Value * getStoredOnceValue() const
If only one value (besides the initializer constant) is ever stored to this global return the stored ...
const Function * AccessingFunction
These start out null/false.
StoredType
Keep track of what stores to the global look like.
@ Stored
This global is stored to by multiple values or something else that we cannot track.
@ InitializerStored
This global is stored to, but the only thing stored is the constant it was initialized with.
@ NotStored
There is no store to this global. It can thus be marked constant.
@ StoredOnce
This global is stored to, but only its initializer and one other value is ever stored to it.
static bool analyzeGlobal(const Value *V, GlobalStatus &GS)
Look at all uses of the global and fill in the GlobalStatus structure.