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:29

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 enum StoredType StoredType = NotStored
public llvm::Value* StoredOnceValue = nullptr
If only one value (besides the initializer constant) is ever stored to this global, keep track of what value it is.
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 bool HasNonInstructionUser = false
Set to true if this global has a user that is not an instruction (e.g. a constant expr or GV initializer).
public llvm::AtomicOrdering Ordering = AtomicOrdering::NotAtomic
Set to the strongest atomic ordering requirement.

Method Overview

Methods

GlobalStatus()

Declared at: llvm/include/llvm/Transforms/Utils/GlobalStatus.h:74

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:79

Parameters

const llvm::Value* V
llvm::GlobalStatus& GS