llvm::ReassociatePass

Reassociate commutative expressions.

Synopsis

Declared in <llvm/Transforms/Scalar/Reassociate.h>

class ReassociatePass
    : public OptionalPassInfoMixin<ReassociatePass>

Base Classes

NameDescription
OptionalPassInfoMixin<ReassociatePass>A CRTP mix-in for passes that can be skipped.

Type Aliases

NameDescription
OrderedSet Ordered set of instructions queued for another optimization pass.

Member Functions

NameDescription
run Run reassociation over the function.
runImpl Run reassociation using an explicitly supplied uniformity analysis.

Static Member Functions

NameDescription
isRequired Return false; optional passes may be skipped.

Protected Types

NameDescription
PairMapValue Cached pairing of two values with a score for global reassociation.

Protected Data Members

NameDescription
MadeChange Whether the pass has modified the function.
PairMap Per-opcode maps from value pairs to their observed reassociation scores.
RankMap Map from basic blocks to their reassociation ranks.
RedoInsts Instructions queued for another optimization pass.
UA Uniformity analysis used when optimizing for divergent control flow.
ValueRankMap Map from values to their reassociation ranks.

Protected Static Data Members

NameDescription
GlobalReassociateLimit Maximum number of global reassociation attempts per pair.
NumBinaryOps Number of binary operator opcodes tracked in PairMap.