LLVM 23.0.0git
GISelValueTracking.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "gisel-known-bits"
 Provides analysis for querying information about KnownBits during GISel passes.

Functions

 INITIALIZE_PASS (GISelValueTrackingAnalysisLegacy, DEBUG_TYPE, "Analysis for ComputingKnownBits", false, true) GISelValueTracking
static void dumpResult (const MachineInstr &MI, const KnownBits &Known, unsigned Depth)
static KnownBits extractBits (unsigned BitWidth, const KnownBits &SrcOpKnown, const KnownBits &OffsetKnown, const KnownBits &WidthKnown)
static bool isAbsoluteValueULEOne (Register R, const MachineRegisterInfo &MRI)
 Return true if this value is known to be the fractional part x - floor(x), which lies in [0, 1).
static unsigned computeNumSignBitsFromRangeMetadata (const GAnyLoad *Ld, unsigned TyBits)
 Compute the known number of sign bits with attached range metadata in the memory operand.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "gisel-known-bits"

Provides analysis for querying information about KnownBits during GISel passes.

Definition at line 42 of file GISelValueTracking.cpp.

Function Documentation

◆ computeNumSignBitsFromRangeMetadata()

unsigned computeNumSignBitsFromRangeMetadata ( const GAnyLoad * Ld,
unsigned TyBits )
static

Compute the known number of sign bits with attached range metadata in the memory operand.

If this is an extending load, accounts for the behavior of the high bits.

Definition at line 1999 of file GISelValueTracking.cpp.

References llvm::ConstantRange::getBitWidth(), llvm::getConstantRangeFromMetadata(), llvm::APInt::getNumSignBits(), llvm::MachineInstr::getOpcode(), llvm::GAnyLoad::getRanges(), llvm::ConstantRange::getSignedMax(), llvm::ConstantRange::getSignedMin(), llvm::ConstantRange::signExtend(), and llvm::ConstantRange::zeroExtend().

Referenced by llvm::GISelValueTracking::computeNumSignBits().

◆ dumpResult()

◆ extractBits()

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( GISelValueTrackingAnalysisLegacy ,
DEBUG_TYPE ,
"Analysis for ComputingKnownBits" ,
false ,
true  )

Definition at line 49 of file GISelValueTracking.cpp.

References DEBUG_TYPE, DL, and getFunction().

◆ isAbsoluteValueULEOne()

bool isAbsoluteValueULEOne ( Register R,
const MachineRegisterInfo & MRI )
static

Return true if this value is known to be the fractional part x - floor(x), which lies in [0, 1).

This implies the value cannot introduce overflow in a fmul when the other operand is known finite.

Definition at line 907 of file GISelValueTracking.cpp.

References llvm::MIPatternMatch::m_DeferredReg(), llvm::MIPatternMatch::m_GFFloor(), llvm::MIPatternMatch::m_GFSub(), llvm::MIPatternMatch::m_Reg(), and llvm::MIPatternMatch::mi_match().