diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -1860,6 +1860,12 @@ AttrOperand.setImm(AttrOperand.getImm() | (uint32_t)Attr); } + bool containsImplicitRegister() const { + return any_of(operands(), [](const MachineOperand &MO) { + return MO.isReg() && MO.isImplicit(); + }); + } + private: /// If this instruction is embedded into a MachineFunction, return the /// MachineRegisterInfo object for the current function, otherwise