LLVM 17.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. | |
![]() | |
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 35 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 135 of file GISelKnownBits.cpp.
References llvm::KnownBits::anyext(), llvm::KnownBits::ashr(), assert(), llvm::bit_width(), llvm::BitWidth, llvm::KnownBits::byteSwap(), llvm::APInt::clearLowBits(), llvm::KnownBits::computeForAddSub(), llvm::TargetLowering::computeKnownBitsForFrameIndex(), llvm::TargetLowering::computeKnownBitsForTargetInstr(), llvm::computeKnownBitsFromRangeMetadata(), computeKnownBitsImpl(), llvm::KnownBits::countMaxPopulation(), llvm::dbgs(), llvm::Depth, dumpResult(), extractBits(), llvm::KnownBits::extractBits(), llvm::LLT::getAddressSpace(), llvm::APInt::getAllOnes(), llvm::KnownBits::getBitWidth(), llvm::TargetLoweringBase::getBooleanContents(), llvm::getIConstantVRegVal(), llvm::DataLayout::getIndexSizeInBits(), getMaxDepth(), llvm::MachineMemOperand::getRanges(), getReg(), llvm::LLT::getScalarSizeInBits(), llvm::LLT::getSizeInBits(), llvm::MachineRegisterInfo::getType(), llvm::MachineRegisterInfo::getVRegDef(), llvm::KnownBits::hasConflict(), I, Idx, llvm::KnownBits::insertBits(), llvm::KnownBits::intersectWith(), 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::KnownBits::smax(), llvm::KnownBits::smin(), llvm::KnownBits::umax(), llvm::KnownBits::umin(), llvm::KnownBits::Zero, llvm::TargetLoweringBase::ZeroOrOneBooleanContent, and llvm::KnownBits::zextOrTrunc().
Referenced by computeKnownBitsImpl(), and getKnownBits().
unsigned GISelKnownBits::computeNumSignBits | ( | Register | R, |
const APInt & | DemandedElts, | ||
unsigned | Depth = 0 |
||
) |
Definition at line 607 of file GISelKnownBits.cpp.
References computeNumSignBits(), llvm::TargetLowering::computeNumSignBitsForTargetInstr(), llvm::Depth, llvm::TargetLoweringBase::getBooleanContents(), getKnownBits(), getMaxDepth(), llvm::LLT::getScalarSizeInBits(), llvm::MachineMemOperand::getSizeInBits(), llvm::MachineRegisterInfo::getType(), 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(), matchICmpRedundantTrunc(), and llvm::CombinerHelper::matchRedundantSExtInReg().
Definition at line 756 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 |
Definition at line 53 of file GISelKnownBits.h.
References DL.
KnownBits GISelKnownBits::getKnownBits | ( | MachineInstr & | MI | ) |
Definition at line 55 of file GISelKnownBits.cpp.
References assert(), getKnownBits(), and MI.
Definition at line 61 of file GISelKnownBits.cpp.
References llvm::APInt::getAllOnes(), getKnownBits(), llvm::LLT::getNumElements(), llvm::MachineRegisterInfo::getType(), and llvm::LLT::isVector().
Referenced by llvm::AMDGPULegalizerInfo::buildMultiply(), computeNumSignBits(), getKnownBits(), getKnownOnes(), getKnownZeroes(), llvm::isKnownToBeAPowerOfTwo(), maskedValueIsZero(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::CombinerHelper::matchCombineZextTrunc(), llvm::CombinerHelper::matchICmpToLHSKnownBits(), llvm::CombinerHelper::matchICmpToTrueFalseKnownBits(), llvm::CombinerHelper::matchRedundantAnd(), and llvm::CombinerHelper::matchRedundantOr().
KnownBits GISelKnownBits::getKnownBits | ( | Register | R, |
const APInt & | DemandedElts, | ||
unsigned | Depth = 0 |
||
) |
Definition at line 68 of file GISelKnownBits.cpp.
References assert(), and computeKnownBitsImpl().
Definition at line 89 of file GISelKnownBits.cpp.
References getKnownBits(), and llvm::KnownBits::One.
Definition at line 85 of file GISelKnownBits.cpp.
References getKnownBits(), and llvm::KnownBits::Zero.
Referenced by llvm::CombinerHelper::matchCombineShlOfExtend().
|
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 AMDGPUPostLegalizerCombinerHelper::matchUCharToFloat(), and signBitIsZero().
Definition at line 79 of file GISelKnownBits.cpp.
References llvm::BitWidth, llvm::LLT::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::MachineRegisterInfo::getType(), and maskedValueIsZero().