LLVM  10.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::GISelKnownBits Class Reference

#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"

Inheritance diagram for llvm::GISelKnownBits:
[legend]
Collaboration diagram for llvm::GISelKnownBits:
[legend]

Public Member Functions

 GISelKnownBits (MachineFunction &MF)
 
virtual ~GISelKnownBits ()=default
 
void setMF (MachineFunction &MF)
 
virtual void computeKnownBitsImpl (Register R, KnownBits &Known, const APInt &DemandedElts, unsigned Depth=0)
 
unsigned computeNumSignBits (Register R, const APInt &DemandedElts, unsigned Depth=0)
 
unsigned computeNumSignBits (Register R, unsigned Depth=0)
 
KnownBits getKnownBits (Register R)
 
KnownBits getKnownBits (MachineInstr &MI)
 
APInt getKnownZeroes (Register R)
 
APInt getKnownOnes (Register R)
 
bool maskedValueIsZero (Register Val, const APInt &Mask)
 
bool signBitIsZero (Register Op)
 
void computeKnownBitsForFrameIndex (Register R, KnownBits &Known, const APInt &DemandedElts, unsigned Depth=0)
 
void erasingInstr (MachineInstr &MI) override
 An instruction is about to be erased. More...
 
void createdInstr (MachineInstr &MI) override
 An instruction has been created and inserted into the function. More...
 
void changingInstr (MachineInstr &MI) override
 This instruction is about to be mutated in some way. More...
 
void changedInstr (MachineInstr &MI) override
 This instruction was mutated in some way. More...
 
- Public Member Functions inherited from llvm::GISelChangeObserver
virtual ~GISelChangeObserver ()
 
void changingAllUsesOfReg (const MachineRegisterInfo &MRI, unsigned Reg)
 All the instructions using the given register are being changed. More...
 
void finishedChangingAllUsesOfReg ()
 All instructions reported as changing by changingAllUsesOfReg() have finished being changed. More...
 

Static Public Member Functions

static Align inferAlignmentForFrameIdx (int FrameIdx, int Offset, const MachineFunction &MF)
 
static void computeKnownBitsForAlignment (KnownBits &Known, MaybeAlign Alignment)
 
static MaybeAlign inferPtrAlignment (const MachineInstr &MI)
 

Protected Member Functions

unsigned getMaxDepth () const
 

Detailed Description

Definition at line 29 of file GISelKnownBits.h.

Constructor & Destructor Documentation

◆ GISelKnownBits()

Analysis for true GISelKnownBits::GISelKnownBits ( MachineFunction &  MF)

Definition at line 32 of file GISelKnownBits.cpp.

◆ ~GISelKnownBits()

virtual llvm::GISelKnownBits::~GISelKnownBits ( )
virtualdefault

Member Function Documentation

◆ changedInstr()

void llvm::GISelKnownBits::changedInstr ( MachineInstr &  MI)
inlineoverridevirtual

This instruction was mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 82 of file GISelKnownBits.h.

◆ changingInstr()

void llvm::GISelKnownBits::changingInstr ( MachineInstr &  MI)
inlineoverridevirtual

This instruction is about to be mutated in some way.

Implements llvm::GISelChangeObserver.

Definition at line 81 of file GISelKnownBits.h.

◆ computeKnownBitsForAlignment()

void GISelKnownBits::computeKnownBitsForAlignment ( KnownBits &  Known,
MaybeAlign  Alignment 
)
static

◆ computeKnownBitsForFrameIndex()

void GISelKnownBits::computeKnownBitsForFrameIndex ( Register  R,
KnownBits &  Known,
const APInt &  DemandedElts,
unsigned  Depth = 0 
)

◆ computeKnownBitsImpl()

void GISelKnownBits::computeKnownBitsImpl ( Register  R,
KnownBits &  Known,
const APInt &  DemandedElts,
unsigned  Depth = 0 
)
virtual

Definition at line 90 of file GISelKnownBits.cpp.

References llvm::APInt::ashr(), assert(), computeKnownBitsForFrameIndex(), llvm::TargetLowering::computeKnownBitsForTargetInstr(), llvm::computeKnownBitsFromRangeMetadata(), llvm::KnownBits::countMinLeadingZeros(), llvm::KnownBits::countMinTrailingZeros(), llvm::dbgs(), llvm::Depth, llvm::LLT::getAddressSpace(), llvm::APInt::getBitWidth(), llvm::TargetLoweringBase::getBooleanContents(), llvm::KnownBits::getConstant(), llvm::getConstantVRegVal(), llvm::DataLayout::getIndexSizeInBits(), getMaxDepth(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineMemOperand::getRanges(), llvm::MachineOperand::getReg(), llvm::LLT::getSizeInBits(), llvm::getSizeInBits(), llvm::MachineOperand::getSubReg(), llvm::MachineRegisterInfo::getType(), llvm::MachineRegisterInfo::getVRegDef(), llvm::APInt::getZExtValue(), llvm::KnownBits::hasConflict(), llvm::MachineInstr::hasOneMemOperand(), llvm::KnownBits::isConstant(), llvm::DataLayout::isNonIntegralAddressSpace(), llvm::LLT::isPointer(), llvm::KnownBits::isUnknown(), llvm::LLT::isValid(), llvm::LLT::isVector(), llvm::Register::isVirtual(), LLVM_DEBUG, LLVM_FALLTHROUGH, llvm::APInt::lshr(), llvm::max(), llvm::MachineInstr::memoperands_begin(), MI, llvm::KnownBits::One, llvm::KnownBits::resetAll(), llvm::APInt::setBits(), llvm::APInt::setBitsFrom(), llvm::APInt::setHighBits(), llvm::APInt::setLowBits(), llvm::KnownBits::sext(), llvm::APInt::shl(), llvm::APInt::toString(), llvm::KnownBits::Zero, llvm::TargetLoweringBase::ZeroOrOneBooleanContent, llvm::KnownBits::zext(), and llvm::KnownBits::zextOrTrunc().

Referenced by getKnownBits().

◆ computeNumSignBits() [1/2]

unsigned GISelKnownBits::computeNumSignBits ( Register  R,
const APInt &  DemandedElts,
unsigned  Depth = 0 
)

◆ computeNumSignBits() [2/2]

unsigned GISelKnownBits::computeNumSignBits ( Register  R,
unsigned  Depth = 0 
)

◆ createdInstr()

void llvm::GISelKnownBits::createdInstr ( MachineInstr &  MI)
inlineoverridevirtual

An instruction has been created and inserted into the function.

Note that the instruction might not be a fully fledged instruction at this point and won't be if the MachineFunction::Delegate is calling it. This is because the delegate only sees the construction of the MachineInstr before operands have been added.

Implements llvm::GISelChangeObserver.

Definition at line 80 of file GISelKnownBits.h.

◆ erasingInstr()

void llvm::GISelKnownBits::erasingInstr ( MachineInstr &  MI)
inlineoverridevirtual

An instruction is about to be erased.

Implements llvm::GISelChangeObserver.

Definition at line 79 of file GISelKnownBits.h.

◆ getKnownBits() [1/2]

KnownBits GISelKnownBits::getKnownBits ( Register  R)

◆ getKnownBits() [2/2]

KnownBits GISelKnownBits::getKnownBits ( MachineInstr &  MI)

◆ getKnownOnes()

APInt GISelKnownBits::getKnownOnes ( Register  R)

Definition at line 88 of file GISelKnownBits.cpp.

References getKnownBits(), and llvm::KnownBits::One.

◆ getKnownZeroes()

APInt GISelKnownBits::getKnownZeroes ( Register  R)

Definition at line 84 of file GISelKnownBits.cpp.

References getKnownBits(), and llvm::KnownBits::Zero.

◆ getMaxDepth()

unsigned llvm::GISelKnownBits::getMaxDepth ( ) const
inlineprotected

Definition at line 85 of file GISelKnownBits.h.

Referenced by computeKnownBitsImpl(), and computeNumSignBits().

◆ inferAlignmentForFrameIdx()

Align GISelKnownBits::inferAlignmentForFrameIdx ( int  FrameIdx,
int  Offset,
const MachineFunction &  MF 
)
static

◆ inferPtrAlignment()

MaybeAlign GISelKnownBits::inferPtrAlignment ( const MachineInstr &  MI)
static

◆ maskedValueIsZero()

bool llvm::GISelKnownBits::maskedValueIsZero ( Register  Val,
const APInt &  Mask 
)
inline
Returns
true if 'V & Mask' is known to be zero in DemandedElts. We use this predicate to simplify operations downstream. Mask is known to be zero for bits that V cannot have.

Definition at line 57 of file GISelKnownBits.h.

References computeKnownBitsForAlignment(), computeKnownBitsForFrameIndex(), llvm::Depth, getKnownBits(), inferAlignmentForFrameIdx(), inferPtrAlignment(), llvm::APInt::isSubsetOf(), and signBitIsZero().

Referenced by signBitIsZero().

◆ setMF()

void llvm::GISelKnownBits::setMF ( MachineFunction &  MF)

◆ signBitIsZero()

bool GISelKnownBits::signBitIsZero ( Register  Op)
Returns
true if the sign bit of Op is known to be zero. We use this predicate to simplify operations downstream.

Definition at line 78 of file GISelKnownBits.cpp.

References llvm::LLT::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::MachineRegisterInfo::getType(), and maskedValueIsZero().

Referenced by maskedValueIsZero().


The documentation for this class was generated from the following files: