Test if the given value is known to have exactly one bit set. This differs from computeKnownBits in that it doesn't necessarily determine which bit is set. When OrNegative is true, the value is also considered a power of two if its negation is a power of two (i.e. its absolute value is a power of two).

Synopsis

Declared in <llvm/CodeGen/GlobalISel/Utils.h>

bool
isKnownToBeAPowerOfTwo(
    Register Val,
    MachineRegisterInfo const& MRI,
    GISelValueTracking* ValueTracking = nullptr,
    bool OrNegative = false);

Parameters

Name

Description

Val

Wrapper class representing virtual and physical registers. Should be passed by value.

MRI

MachineRegisterInfo ‐ Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.

Created with MrDocs