29 for (
auto &
op :
instr.all_defs())
37 for (
auto &
T :
block.terminators())
45 for (
auto &
T :
block.terminators())
54 return F->getRegInfo().getVRegDef(value)->
getParent();
58 return MI.getOpcode() == TargetOpcode::G_IMPLICIT_DEF ||
59 MI.getOpcode() == TargetOpcode::IMPLICIT_DEF;
69 if (
Phi.getOpcode() == TargetOpcode::PHI)
70 return Phi.isConstantValuePHI().isValid();
73 const MachineRegisterInfo &
MRI =
Phi.getMF()->getRegInfo();
76 for (
unsigned i = 1, e =
Phi.getNumOperands(); i < e; i += 2) {
78 if (Incoming != This && !
isUndef(*
MRI.getVRegDef(Incoming))) {
79 if (ConstantValue && ConstantValue != Incoming)
81 ConstantValue = Incoming;
90 return GI->getIntrinsicID();
97 return Printable([](raw_ostream &Out) { Out <<
"<nullptr>"; });
98 return Printable([
Block](raw_ostream &Out) {
Block->printName(Out); });
102 return Printable([
I](raw_ostream &Out) {
I->print(Out); });
106 auto *
MRI = &F->getRegInfo();
107 return Printable([
MRI,
Value](raw_ostream &Out) {
112 if (
auto *Instr =
MRI->getUniqueVRegDef(
Value)) {
122 return Printable([BB](raw_ostream &Out) { BB->
printAsOperand(Out); });
unsigned const MachineRegisterInfo * MRI
Declares convenience wrapper classes for interpreting MachineInstr instances as specific generic oper...
static bool isUndef(const MachineInstr &MI)
This file declares a specialization of the GenericSSAContext<X> template class for Machine IR.
Promote Memory to Register
unify loop Fixup each natural loop to have a single exit block
static void appendBlockDefs(SmallVectorImpl< ValueRefT > &defs, BlockT &block)
static bool isConstantOrUndefValuePhi(const InstructionT &Instr)
static void appendBlockTerms(SmallVectorImpl< InstructionT * > &terms, BlockT &block)
static Intrinsic::ID getIntrinsicID(const InstructionT &I)
Printable print(const BlockT *block) const
const BlockT * getDefBlock(ConstValueRefT value) const
Printable printAsOperand(const BlockT *BB) const
LLVM_ABI void printAsOperand(raw_ostream &OS, bool PrintType=true) const
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Representation of each machine instruction.
Simple wrapper around std::function<void(raw_ostream&)>.
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
LLVM Value Representation.
NodeAddr< InstrNode * > Instr
NodeAddr< PhiNode * > Phi
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.