LLVM: lib/CodeGen/PatchableFunction.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

22

23using namespace llvm;

24

25namespace {

27 static char ID;

30 }

31

35 MachineFunctionProperties::Property::NoVRegs);

36 }

37};

38}

39

40bool PatchableFunction::runOnMachineFunction(MachineFunction &MF) {

42

45

47 TII->get(TargetOpcode::PATCHABLE_FUNCTION_ENTER));

48 return true;

50#ifndef NDEBUG

53 assert(PatchType == "prologue-short-redirect" && "Only possibility today!");

54#endif

57 TII->get(TargetOpcode::PATCHABLE_OP))

60 return true;

61 }

62 return false;

63}

64

65char PatchableFunction::ID = 0;

68 "Implement the 'patchable-function' attribute", false, false)

const HexagonInstrInfo * TII

#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)

assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

StringRef getValueAsString() const

Return the attribute's value as a string.

Attribute getFnAttribute(Attribute::AttrKind Kind) const

Return the attribute for the given attribute kind.

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...

virtual bool runOnMachineFunction(MachineFunction &MF)=0

runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...

virtual MachineFunctionProperties getRequiredProperties() const

Properties which a MachineFunction may have at a given point in time.

MachineFunctionProperties & set(Property P)

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.

Function & getFunction()

Return the LLVM function that this machine code represents.

const MachineInstrBuilder & addImm(int64_t Val) const

Add a new immediate operand.

static PassRegistry * getPassRegistry()

getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...

StringRef - Represent a constant reference to a string, i.e.

TargetInstrInfo - Interface to description of machine instruction set.

virtual const TargetInstrInfo * getInstrInfo() const

unsigned ID

LLVM IR allows to use arbitrary numbers as calling convention identifiers.

This is an optimization pass for GlobalISel generic memory operations.

MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)

Builder interface. Specify how to create the initial instruction itself.

char & PatchableFunctionID

This pass implements the "patchable-function" attribute.

void initializePatchableFunctionPass(PassRegistry &)

This struct is a compact representation of a valid (non-zero power of two) alignment.