LLVM 20.0.0git
|
#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
Public Member Functions | |
GISelKnownBits (MachineFunction &MF, unsigned MaxDepth=6) | |
virtual | ~GISelKnownBits ()=default |
const MachineFunction & | getMachineFunction () const |
const DataLayout & | getDataLayout () const |
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 (Register R, const APInt &DemandedElts, unsigned Depth=0) |
KnownBits | getKnownBits (MachineInstr &MI) |
APInt | getKnownZeroes (Register R) |
APInt | getKnownOnes (Register R) |
bool | maskedValueIsZero (Register Val, const APInt &Mask) |
bool | signBitIsZero (Register Op) |
Align | computeKnownAlignment (Register R, unsigned Depth=0) |
void | erasingInstr (MachineInstr &MI) override |
An instruction is about to be erased. | |
void | createdInstr (MachineInstr &MI) override |
An instruction has been created and inserted into the function. | |
void | changingInstr (MachineInstr &MI) override |
This instruction is about to be mutated in some way. | |
void | changedInstr (MachineInstr &MI) override |
This instruction was mutated in some way. | |
Public Member Functions inherited from llvm::GISelChangeObserver | |
virtual | ~GISelChangeObserver ()=default |
virtual void | erasingInstr (MachineInstr &MI)=0 |
An instruction is about to be erased. | |
virtual void | createdInstr (MachineInstr &MI)=0 |
An instruction has been created and inserted into the function. | |
virtual void | changingInstr (MachineInstr &MI)=0 |
This instruction is about to be mutated in some way. | |
virtual void | changedInstr (MachineInstr &MI)=0 |
This instruction was mutated in some way. | |
void | changingAllUsesOfReg (const MachineRegisterInfo &MRI, Register Reg) |
All the instructions using the given register are being changed. | |
void | finishedChangingAllUsesOfReg () |
All instructions reported as changing by changingAllUsesOfReg() have finished being changed. | |
Static Public Member Functions | |
static void | computeKnownBitsForAlignment (KnownBits &Known, Align Alignment) |
Protected Member Functions | |
unsigned | getMaxDepth () const |
Definition at line 29 of file GISelKnownBits.h.
llvm::GISelKnownBits::GISelKnownBits | ( | MachineFunction & | MF, |
unsigned | MaxDepth = 6 |
||
) |
|
virtualdefault |
|
inlineoverridevirtual |
This instruction was mutated in some way.
Implements llvm::GISelChangeObserver.
Definition at line 99 of file GISelKnownBits.h.
|
inlineoverridevirtual |
This instruction is about to be mutated in some way.
Implements llvm::GISelChangeObserver.
Definition at line 98 of file GISelKnownBits.h.
R
. Definition at line 38 of file GISelKnownBits.cpp.
References llvm::TargetLowering::computeKnownAlignForTargetInstr(), computeKnownAlignment(), llvm::Depth, llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineRegisterInfo::getVRegDef(), and MI.
Referenced by computeKnownAlignment().
|
inlinestatic |
Definition at line 86 of file GISelKnownBits.h.
References llvm::Log2(), llvm::APInt::setLowBits(), and llvm::KnownBits::Zero.
|
virtual |
Definition at line 143 of file GISelKnownBits.cpp.
References llvm::KnownBits::add(), llvm::KnownBits::anyext(), llvm::KnownBits::anyextOrTrunc(), llvm::KnownBits::ashr(), assert(), llvm::bit_width(), llvm::BitWidth, llvm::KnownBits::byteSwap(), llvm::APInt::clearLowBits(), llvm::TargetLowering::computeKnownBitsForFrameIndex(), llvm::TargetLowering::computeKnownBitsForTargetInstr(), llvm::computeKnownBitsFromRangeMetadata(), computeKnownBitsImpl(), llvm::KnownBits::countMaxLeadingZeros(), llvm::KnownBits::countMaxPopulation(), llvm::dbgs(), llvm::Depth, dumpResult(), llvm::extractBits(), llvm::KnownBits::extractBits(), llvm::LLT::getAddressSpace(), llvm::APInt::getAllOnes(), llvm::APInt::getBitWidth(), llvm::KnownBits::getBitWidth(), llvm::TargetLoweringBase::getBooleanContents(), llvm::DataLayout::getIndexSizeInBits(), getMaxDepth(), llvm::MachineMemOperand::getMemoryType(), llvm::LLT::getNumElements(), llvm::MachineMemOperand::getRanges(), getReg(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getScalarType(), llvm::LLT::getSizeInBits(), llvm::MachineRegisterInfo::getType(), llvm::MachineRegisterInfo::getVRegDef(), I, Idx, llvm::KnownBits::insertBits(), llvm::KnownBits::intersectWith(), llvm::LLT::isFixedVector(), llvm::DataLayout::isNonIntegralAddressSpace(), llvm::LLT::isPointer(), llvm::KnownBits::isUnknown(), llvm::LLT::isValid(), llvm::LLT::isVector(), llvm::Register::isVirtual(), LLVM_DEBUG, llvm::Log2_64(), llvm::KnownBits::lshr(), llvm::KnownBits::makeConstant(), MI, llvm::KnownBits::mul(), llvm::KnownBits::One, llvm::KnownBits::reverseBits(), llvm::APInt::setAllBits(), llvm::APInt::setBitsFrom(), llvm::APInt::setLowBits(), llvm::KnownBits::sext(), llvm::KnownBits::sextInReg(), llvm::KnownBits::shl(), llvm::APInt::shl(), llvm::KnownBits::smax(), llvm::KnownBits::smin(), llvm::KnownBits::sub(), llvm::KnownBits::umax(), llvm::KnownBits::umin(), llvm::KnownBits::Zero, llvm::TargetLoweringBase::ZeroOrOneBooleanContent, llvm::KnownBits::zext(), llvm::APInt::zext(), and llvm::KnownBits::zextOrTrunc().
Referenced by llvm::SITargetLowering::computeKnownBitsForTargetInstr(), computeKnownBitsImpl(), and getKnownBits().
unsigned GISelKnownBits::computeNumSignBits | ( | Register | R, |
const APInt & | DemandedElts, | ||
unsigned | Depth = 0 |
||
) |
Definition at line 673 of file GISelKnownBits.cpp.
References computeNumSignBits(), llvm::TargetLowering::computeNumSignBitsForTargetInstr(), computeNumSignBitsFromRangeMetadata(), llvm::Depth, llvm::TargetLoweringBase::getBooleanContents(), getDataLayout(), getKnownBits(), getMaxDepth(), llvm::LLT::getScalarSizeInBits(), llvm::MachineMemOperand::getSizeInBits(), llvm::MachineRegisterInfo::getType(), llvm::LocationSize::getValue(), llvm::MachineRegisterInfo::getVRegDef(), llvm::KnownBits::isNegative(), llvm::KnownBits::isNonNegative(), llvm::LLT::isValid(), llvm::LLT::isVector(), MI, llvm::KnownBits::One, llvm::KnownBits::Zero, llvm::TargetLoweringBase::ZeroOrNegativeOneBooleanContent, and llvm::TargetLoweringBase::ZeroOrOneBooleanContent.
Referenced by computeNumSignBits(), llvm::CombinerHelper::matchAddOverflow(), llvm::CombinerHelper::matchRedundantSExtInReg(), and llvm::LegalizationArtifactCombiner::tryCombineSExt().
Definition at line 865 of file GISelKnownBits.cpp.
References computeNumSignBits(), llvm::Depth, llvm::APInt::getAllOnes(), llvm::LLT::getNumElements(), llvm::MachineRegisterInfo::getType(), and llvm::LLT::isVector().
|
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 97 of file GISelKnownBits.h.
|
inlineoverridevirtual |
An instruction is about to be erased.
Implements llvm::GISelChangeObserver.
Definition at line 96 of file GISelKnownBits.h.
|
inline |
KnownBits GISelKnownBits::getKnownBits | ( | MachineInstr & | MI | ) |
Definition at line 60 of file GISelKnownBits.cpp.
References assert(), getKnownBits(), and MI.
Definition at line 66 of file GISelKnownBits.cpp.
References llvm::APInt::getAllOnes(), getKnownBits(), llvm::LLT::getNumElements(), llvm::MachineRegisterInfo::getType(), and llvm::LLT::isFixedVector().
Referenced by llvm::AMDGPULegalizerInfo::buildMultiply(), llvm::CombinerHelper::buildUDivUsingMul(), computeNumSignBits(), getKnownBits(), getKnownOnes(), getKnownZeroes(), llvm::isKnownToBeAPowerOfTwo(), maskedValueIsZero(), llvm::CombinerHelper::matchAddOverflow(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::CombinerHelper::matchCombineZextTrunc(), llvm::CombinerHelper::matchICmpToLHSKnownBits(), llvm::CombinerHelper::matchICmpToTrueFalseKnownBits(), llvm::CombinerHelper::matchRedundantAnd(), llvm::CombinerHelper::matchRedundantOr(), and llvm::CombinerHelper::matchSuboCarryOut().
KnownBits GISelKnownBits::getKnownBits | ( | Register | R, |
const APInt & | DemandedElts, | ||
unsigned | Depth = 0 |
||
) |
Definition at line 76 of file GISelKnownBits.cpp.
References assert(), computeKnownBitsImpl(), and llvm::Depth.
Definition at line 97 of file GISelKnownBits.cpp.
References getKnownBits(), and llvm::KnownBits::One.
Definition at line 93 of file GISelKnownBits.cpp.
References getKnownBits(), and llvm::KnownBits::Zero.
Referenced by llvm::CombinerHelper::matchCombineShlOfExtend(), and llvm::LegalizationArtifactCombiner::tryCombineZExt().
|
inline |
Definition at line 49 of file GISelKnownBits.h.
Referenced by llvm::SITargetLowering::computeKnownAlignForTargetInstr(), and knownBitsForWorkitemID().
|
inlineprotected |
Definition at line 102 of file GISelKnownBits.h.
Referenced by computeKnownBitsImpl(), and computeNumSignBits().
Definition at line 78 of file GISelKnownBits.h.
References getKnownBits().
Referenced by signBitIsZero().
Definition at line 87 of file GISelKnownBits.cpp.
References llvm::BitWidth, llvm::LLT::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::MachineRegisterInfo::getType(), and maskedValueIsZero().