45 default:
return false;
46 case TargetOpcode::IMPLICIT_DEF:
48 case TargetOpcode::CFI_INSTRUCTION:
50 case TargetOpcode::GC_LABEL:
51 case TargetOpcode::DBG_VALUE:
52 case TargetOpcode::DBG_LABEL:
61 if (FirstMBB.
empty()) {
63 TII->
get(TargetOpcode::PATCHABLE_FUNCTION_ENTER));
67 TII->
get(TargetOpcode::PATCHABLE_FUNCTION_ENTER));
78 assert(PatchType ==
"prologue-short-redirect" &&
"Only possibility today!");
81 auto &FirstMBB = *MF.
begin();
84 assert(FirstActualI != FirstMBB.end());
87 auto MIB =
BuildMI(FirstMBB, FirstActualI, FirstActualI->getDebugLoc(),
88 TII->get(TargetOpcode::PATCHABLE_OP))
90 .
addImm(FirstActualI->getOpcode());
92 for (
auto &MO : FirstActualI->operands())
95 FirstActualI->eraseFromParent();
103 "Implement the 'patchable-function' attribute",
false,
false)
const MachineInstrBuilder & add(const MachineOperand &MO) const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
void initializePatchableFunctionPass(PassRegistry &)
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
static bool doesNotGeneratecode(const MachineInstr &MI)
Returns true if instruction MI will not result in actual machine code instructions.
virtual const TargetInstrInfo * getInstrInfo() const
TargetInstrInfo - Interface to description of machine instruction set.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MachineFunctionProperties & set(Property P)
Representation of each machine instruction.
char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
StringRef getValueAsString() const
Return the attribute's value as a string.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
StringRef - Represent a constant reference to a string, i.e.
Properties which a MachineFunction may have at a given point in time.