LLVM: lib/Target/ARM/ARMInstrInfo.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

26using namespace llvm;

27

30

31

39 } else {

46 }

47 return NopInst;

48}

49

51 switch (Opc) {

52 default:

53 break;

54 case ARM::LDR_PRE_IMM:

55 case ARM::LDR_PRE_REG:

56 case ARM::LDR_POST_IMM:

57 case ARM::LDR_POST_REG:

58 return ARM::LDRi12;

59 case ARM::LDRH_PRE:

60 case ARM::LDRH_POST:

61 return ARM::LDRH;

62 case ARM::LDRB_PRE_IMM:

63 case ARM::LDRB_PRE_REG:

64 case ARM::LDRB_POST_IMM:

65 case ARM::LDRB_POST_REG:

66 return ARM::LDRBi12;

67 case ARM::LDRSH_PRE:

68 case ARM::LDRSH_POST:

69 return ARM::LDRSH;

70 case ARM::LDRSB_PRE:

71 case ARM::LDRSB_POST:

72 return ARM::LDRSB;

73 case ARM::STR_PRE_IMM:

74 case ARM::STR_PRE_REG:

75 case ARM::STR_POST_IMM:

76 case ARM::STR_POST_REG:

77 return ARM::STRi12;

78 case ARM::STRH_PRE:

79 case ARM::STRH_POST:

80 return ARM::STRH;

81 case ARM::STRB_PRE_IMM:

82 case ARM::STRB_PRE_REG:

83 case ARM::STRB_POST_IMM:

84 case ARM::STRB_POST_REG:

85 return ARM::STRBi12;

86 }

87

88 return 0;

89}

90

96

97 if (M.getStackProtectorGuard() == "tls") {

99 return;

100 }

101

104

106 if (!Subtarget.useMovt() || ForceELFGOTPIC) {

107

108

109 if (TM.isPositionIndependent() || ForceELFGOTPIC)

111 else

113 return;

114 }

115

116 if (!TM.isPositionIndependent()) {

118 return;

119 }

120

121 if (!Subtarget.isGVIndirectSymbol(GV)) {

123 return;

124 }

125

126 MachineBasicBlock &MBB = *MI->getParent();

129 MachineInstrBuilder MIB;

130

144}

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

Module.h This file contains the declarations for the Module class.

Promote Memory to Register

void expandLoadStackGuardBase(MachineBasicBlock::iterator MI, unsigned LoadImmOpc, unsigned LoadOpc) const

ARMBaseInstrInfo(const ARMSubtarget &STI, const ARMBaseRegisterInfo &TRI)

unsigned getUnindexedOpcode(unsigned Opc) const override

Definition ARMInstrInfo.cpp:50

ARMInstrInfo(const ARMSubtarget &STI)

Definition ARMInstrInfo.cpp:28

MCInst getNop() const override

Return the noop instruction to use for a noop.

Definition ARMInstrInfo.cpp:32

Module * getParent()

Get the module that this global value is contained inside of...

Instances of this class represent a single low-level machine instruction.

void addOperand(const MCOperand Op)

void setOpcode(unsigned Op)

static MCOperand createReg(MCRegister Reg)

static MCOperand createImm(int64_t Val)

const MachineFunction * getParent() const

Return the MachineFunction containing this basic block.

MachineInstrBundleIterator< MachineInstr > iterator

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)

getMachineMemOperand - Allocate a new MachineMemOperand.

Function & getFunction()

Return the LLVM function that this machine code represents.

const TargetMachine & getTarget() const

getTarget - Return the target machine this machine code is compiled with

const MachineInstrBuilder & addImm(int64_t Val) const

Add a new immediate operand.

const MachineInstrBuilder & add(const MachineOperand &MO) const

const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const

const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const

Add a new virtual register operand.

const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) const

const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const

@ MODereferenceable

The memory access is dereferenceable (i.e., doesn't trap).

@ MOLoad

The memory access reads data.

@ MOInvariant

The memory access always returns the same value (or traps).

A Module instance is used to store all the information related to an LLVM module.

Primary interface to the complete machine description for the target machine.

constexpr char Align[]

Key for Kernel::Arg::Metadata::mAlign.

@ MO_NONLAZY

MO_NONLAZY - This is an independent flag, on a symbol operand "FOO" it represents a symbol which,...

@ Kill

The last use of a register.

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.

static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)

Get the operands corresponding to the given Pred value.

decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

static LLVM_ABI MachinePointerInfo getGOT(MachineFunction &MF)

Return a MachinePointerInfo record that refers to a GOT entry.