struct GlobalStatus
Declaration
struct GlobalStatus { /* full declaration omitted */ };
Description
As we analyze each global, keep track of some information about it. If we find out that the address of the global is taken, none of this info will be accurate.
Declared at: llvm/include/llvm/Transforms/Utils/GlobalStatus.h:30
Member Variables
- public bool IsCompared = false
- True if the global's address is used in a comparison.
- public bool IsLoaded = false
- True if the global is ever loaded. If the global isn't ever loaded it can be deleted.
- public unsigned int NumStores = 0
- Number of stores to the global.
- public enum StoredType StoredType = NotStored
- public const llvm::StoreInst* StoredOnceStore = nullptr
- If only one value (besides the initializer constant) is ever stored to this global, keep track of what value it is via the store instruction.
- public const llvm::Function* AccessingFunction = nullptr
- These start out null/false. When the first accessing function is noticed, it is recorded. When a second different accessing function is noticed, HasMultipleAccessingFunctions is set to true.
- public bool HasMultipleAccessingFunctions = false
- public llvm::AtomicOrdering Ordering = AtomicOrdering::NotAtomic
- Set to the strongest atomic ordering requirement.
Method Overview
- public GlobalStatus()
- public static bool analyzeGlobal(const llvm::Value * V, llvm::GlobalStatus & GS)
- public llvm::Value * getStoredOnceValue() const
Methods
¶GlobalStatus()
GlobalStatus()
Declared at: llvm/include/llvm/Transforms/Utils/GlobalStatus.h:82
¶static bool analyzeGlobal(const llvm::Value* V,
llvm::GlobalStatus& GS)
static bool analyzeGlobal(const llvm::Value* V,
llvm::GlobalStatus& GS)
Description
Look at all uses of the global and fill in the GlobalStatus structure. If the global has its address taken, return true to indicate we can't do anything with it.
Declared at: llvm/include/llvm/Transforms/Utils/GlobalStatus.h:87
Parameters
- const llvm::Value* V
- llvm::GlobalStatus& GS
¶llvm::Value* getStoredOnceValue() const
llvm::Value* getStoredOnceValue() const
Description
If only one value (besides the initializer constant) is ever stored to this global return the stored value.
Declared at: llvm/include/llvm/Transforms/Utils/GlobalStatus.h:67