class GlobalNumberState

Declaration

class GlobalNumberState { /* full declaration omitted */ };

Description

GlobalNumberState assigns an integer to each global value in the program, which is used by the comparison routine to order references to globals. This state must be preserved throughout the pass, because Functions and other globals need to maintain their relative order. Globals are assigned a number when they are first visited. This order is deterministic, and so the assigned numbers are as well. When two functions are merged, neither number is updated. If the symbols are weak, this would be incorrect. If they are strong, then one will be replaced at all references to the other, and so direct callsites will now see one or the other symbol, and no update is necessary. Note that if we were guaranteed unique names, we could just compare those, but this would not work for stripped bitcodes or for those few symbols without a name.

Declared at: llvm/include/llvm/Transforms/Utils/FunctionComparator.h:54

Member Variables

private llvm::GlobalNumberState::ValueNumberMap GlobalNumbers
private uint64_t NextNumber = 0

Method Overview

Methods

GlobalNumberState()

Declared at: llvm/include/llvm/Transforms/Utils/FunctionComparator.h:69

void clear()

Declared at: llvm/include/llvm/Transforms/Utils/FunctionComparator.h:84

void erase(llvm::GlobalValue* Global)

Declared at: llvm/include/llvm/Transforms/Utils/FunctionComparator.h:80

Parameters

llvm::GlobalValue* Global

uint64_t getNumber(llvm::GlobalValue* Global)

Declared at: llvm/include/llvm/Transforms/Utils/FunctionComparator.h:71

Parameters

llvm::GlobalValue* Global