LLVM 20.0.0git
Mips16InstrInfo.cpp
Go to the documentation of this file.
1//===- Mips16InstrInfo.cpp - Mips16 Instruction Information ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the Mips16 implementation of the TargetInstrInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#include "Mips16InstrInfo.h"
14#include "llvm/ADT/BitVector.h"
24#include "llvm/IR/DebugLoc.h"
27#include <cassert>
28#include <cctype>
29#include <cstdint>
30#include <cstdlib>
31#include <cstring>
32#include <iterator>
33#include <vector>
34
35using namespace llvm;
36
37#define DEBUG_TYPE "mips16-instrinfo"
38
40 : MipsInstrInfo(STI, Mips::Bimm16) {}
41
43 return RI;
44}
45
46/// isLoadFromStackSlot - If the specified machine instruction is a direct
47/// load from a stack slot, return the virtual or physical register number of
48/// the destination along with the FrameIndex of the loaded stack slot. If
49/// not, return 0. This predicate must return 0 if the instruction has
50/// any side effects other than loading from the stack slot.
52 int &FrameIndex) const {
53 return 0;
54}
55
56/// isStoreToStackSlot - If the specified machine instruction is a direct
57/// store to a stack slot, return the virtual or physical register number of
58/// the source reg along with the FrameIndex of the loaded stack slot. If
59/// not, return 0. This predicate must return 0 if the instruction has
60/// any side effects other than storing to the stack slot.
62 int &FrameIndex) const {
63 return 0;
64}
65
68 const DebugLoc &DL, MCRegister DestReg,
69 MCRegister SrcReg, bool KillSrc,
70 bool RenamableDest, bool RenamableSrc) const {
71 unsigned Opc = 0;
72
73 if (Mips::CPU16RegsRegClass.contains(DestReg) &&
74 Mips::GPR32RegClass.contains(SrcReg))
75 Opc = Mips::MoveR3216;
76 else if (Mips::GPR32RegClass.contains(DestReg) &&
77 Mips::CPU16RegsRegClass.contains(SrcReg))
78 Opc = Mips::Move32R16;
79 else if ((SrcReg == Mips::HI0) &&
80 (Mips::CPU16RegsRegClass.contains(DestReg)))
81 Opc = Mips::Mfhi16, SrcReg = 0;
82 else if ((SrcReg == Mips::LO0) &&
83 (Mips::CPU16RegsRegClass.contains(DestReg)))
84 Opc = Mips::Mflo16, SrcReg = 0;
85
86 assert(Opc && "Cannot copy registers");
87
88 MachineInstrBuilder MIB = BuildMI(MBB, I, DL, get(Opc));
89
90 if (DestReg)
91 MIB.addReg(DestReg, RegState::Define);
92
93 if (SrcReg)
94 MIB.addReg(SrcReg, getKillRegState(KillSrc));
95}
96
97std::optional<DestSourcePair>
99 if (MI.isMoveReg())
100 return DestSourcePair{MI.getOperand(0), MI.getOperand(1)};
101 return std::nullopt;
102}
103
106 Register SrcReg, bool isKill, int FI,
107 const TargetRegisterClass *RC,
108 const TargetRegisterInfo *TRI,
109 int64_t Offset) const {
110 DebugLoc DL;
111 if (I != MBB.end()) DL = I->getDebugLoc();
113 unsigned Opc = 0;
114 if (Mips::CPU16RegsRegClass.hasSubClassEq(RC))
115 Opc = Mips::SwRxSpImmX16;
116 assert(Opc && "Register class not handled!");
117 BuildMI(MBB, I, DL, get(Opc)).addReg(SrcReg, getKillRegState(isKill)).
118 addFrameIndex(FI).addImm(Offset)
119 .addMemOperand(MMO);
120}
121
124 Register DestReg, int FI,
125 const TargetRegisterClass *RC,
126 const TargetRegisterInfo *TRI,
127 int64_t Offset) const {
128 DebugLoc DL;
129 if (I != MBB.end()) DL = I->getDebugLoc();
131 unsigned Opc = 0;
132
133 if (Mips::CPU16RegsRegClass.hasSubClassEq(RC))
134 Opc = Mips::LwRxSpImmX16;
135 assert(Opc && "Register class not handled!");
136 BuildMI(MBB, I, DL, get(Opc), DestReg).addFrameIndex(FI).addImm(Offset)
137 .addMemOperand(MMO);
138}
139
141 MachineBasicBlock &MBB = *MI.getParent();
142 switch (MI.getDesc().getOpcode()) {
143 default:
144 return false;
145 case Mips::RetRA16:
146 ExpandRetRA16(MBB, MI, Mips::JrcRa16);
147 break;
148 }
149
150 MBB.erase(MI.getIterator());
151 return true;
152}
153
154/// GetOppositeBranchOpc - Return the inverse of the specified
155/// opcode, e.g. turning BEQ to BNE.
156unsigned Mips16InstrInfo::getOppositeBranchOpc(unsigned Opc) const {
157 switch (Opc) {
158 case Mips::BeqzRxImmX16: return Mips::BnezRxImmX16;
159 case Mips::BnezRxImmX16: return Mips::BeqzRxImmX16;
160 case Mips::BeqzRxImm16: return Mips::BnezRxImm16;
161 case Mips::BnezRxImm16: return Mips::BeqzRxImm16;
162 case Mips::BteqzT8CmpX16: return Mips::BtnezT8CmpX16;
163 case Mips::BteqzT8SltX16: return Mips::BtnezT8SltX16;
164 case Mips::BteqzT8SltiX16: return Mips::BtnezT8SltiX16;
165 case Mips::Btnez16: return Mips::Bteqz16;
166 case Mips::BtnezX16: return Mips::BteqzX16;
167 case Mips::BtnezT8CmpiX16: return Mips::BteqzT8CmpiX16;
168 case Mips::BtnezT8SltuX16: return Mips::BteqzT8SltuX16;
169 case Mips::BtnezT8SltiuX16: return Mips::BteqzT8SltiuX16;
170 case Mips::Bteqz16: return Mips::Btnez16;
171 case Mips::BteqzX16: return Mips::BtnezX16;
172 case Mips::BteqzT8CmpiX16: return Mips::BtnezT8CmpiX16;
173 case Mips::BteqzT8SltuX16: return Mips::BtnezT8SltuX16;
174 case Mips::BteqzT8SltiuX16: return Mips::BtnezT8SltiuX16;
175 case Mips::BtnezT8CmpX16: return Mips::BteqzT8CmpX16;
176 case Mips::BtnezT8SltX16: return Mips::BteqzT8SltX16;
177 case Mips::BtnezT8SltiX16: return Mips::BteqzT8SltiX16;
178 }
179 llvm_unreachable("Illegal opcode!");
180}
181
184 unsigned Flags = 0) {
185 for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
186 // Add the callee-saved register as live-in. Do not add if the register is
187 // RA and return address is taken, because it has already been added in
188 // method MipsTargetLowering::lowerRETURNADDR.
189 // It's killed at the spill, unless the register is RA and return address
190 // is taken.
191 Register Reg = CSI[e-i-1].getReg();
192 switch (Reg) {
193 case Mips::RA:
194 case Mips::S0:
195 case Mips::S1:
196 MIB.addReg(Reg, Flags);
197 break;
198 case Mips::S2:
199 break;
200 default:
201 llvm_unreachable("unexpected mips16 callee saved register");
202
203 }
204 }
205}
206
207// Adjust SP by FrameSize bytes. Save RA, S0, S1
208void Mips16InstrInfo::makeFrame(unsigned SP, int64_t FrameSize,
211 DebugLoc DL;
213 MachineFrameInfo &MFI = MF.getFrameInfo();
214 const BitVector Reserved = RI.getReservedRegs(MF);
215 bool SaveS2 = Reserved[Mips::S2];
217 unsigned Opc = ((FrameSize <= 128) && !SaveS2)? Mips::Save16:Mips::SaveX16;
218 MIB = BuildMI(MBB, I, DL, get(Opc));
219 const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();
220 addSaveRestoreRegs(MIB, CSI);
221 if (SaveS2)
222 MIB.addReg(Mips::S2);
223 if (isUInt<11>(FrameSize))
224 MIB.addImm(FrameSize);
225 else {
226 int Base = 2040; // should create template function like isUInt that
227 // returns largest possible n bit unsigned integer
228 int64_t Remainder = FrameSize - Base;
229 MIB.addImm(Base);
230 if (isInt<16>(-Remainder))
231 BuildAddiuSpImm(MBB, I, -Remainder);
232 else
233 adjustStackPtrBig(SP, -Remainder, MBB, I, Mips::V0, Mips::V1);
234 }
235}
236
237// Adjust SP by FrameSize bytes. Restore RA, S0, S1
238void Mips16InstrInfo::restoreFrame(unsigned SP, int64_t FrameSize,
241 DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
243 MachineFrameInfo &MFI = MF->getFrameInfo();
244 const BitVector Reserved = RI.getReservedRegs(*MF);
245 bool SaveS2 = Reserved[Mips::S2];
247 unsigned Opc = ((FrameSize <= 128) && !SaveS2)?
248 Mips::Restore16:Mips::RestoreX16;
249
250 if (!isUInt<11>(FrameSize)) {
251 unsigned Base = 2040;
252 int64_t Remainder = FrameSize - Base;
253 FrameSize = Base; // should create template function like isUInt that
254 // returns largest possible n bit unsigned integer
255
256 if (isInt<16>(Remainder))
257 BuildAddiuSpImm(MBB, I, Remainder);
258 else
259 adjustStackPtrBig(SP, Remainder, MBB, I, Mips::A0, Mips::A1);
260 }
261 MIB = BuildMI(MBB, I, DL, get(Opc));
262 const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();
264 if (SaveS2)
265 MIB.addReg(Mips::S2, RegState::Define);
266 MIB.addImm(FrameSize);
267}
268
269// Adjust SP by Amount bytes where bytes can be up to 32bit number.
270// This can only be called at times that we know that there is at least one free
271// register.
272// This is clearly safe at prologue and epilogue.
273void Mips16InstrInfo::adjustStackPtrBig(unsigned SP, int64_t Amount,
276 unsigned Reg1, unsigned Reg2) const {
277 DebugLoc DL;
278 //
279 // li reg1, constant
280 // move reg2, sp
281 // add reg1, reg1, reg2
282 // move sp, reg1
283 //
284 //
285 MachineInstrBuilder MIB1 = BuildMI(MBB, I, DL, get(Mips::LwConstant32), Reg1);
286 MIB1.addImm(Amount).addImm(-1);
287 MachineInstrBuilder MIB2 = BuildMI(MBB, I, DL, get(Mips::MoveR3216), Reg2);
288 MIB2.addReg(Mips::SP, RegState::Kill);
289 MachineInstrBuilder MIB3 = BuildMI(MBB, I, DL, get(Mips::AdduRxRyRz16), Reg1);
290 MIB3.addReg(Reg1);
291 MIB3.addReg(Reg2, RegState::Kill);
292 MachineInstrBuilder MIB4 = BuildMI(MBB, I, DL, get(Mips::Move32R16),
293 Mips::SP);
294 MIB4.addReg(Reg1, RegState::Kill);
295}
296
297void Mips16InstrInfo::adjustStackPtrBigUnrestricted(
298 unsigned SP, int64_t Amount, MachineBasicBlock &MBB,
300 llvm_unreachable("adjust stack pointer amount exceeded");
301}
302
303/// Adjust SP by Amount bytes.
304void Mips16InstrInfo::adjustStackPtr(unsigned SP, int64_t Amount,
307 if (Amount == 0)
308 return;
309
310 if (isInt<16>(Amount)) // need to change to addiu sp, ....and isInt<16>
311 BuildAddiuSpImm(MBB, I, Amount);
312 else
313 adjustStackPtrBigUnrestricted(SP, Amount, MBB, I);
314}
315
316/// This function generates the sequence of instructions needed to get the
317/// result of adding register REG and immediate IMM.
318unsigned Mips16InstrInfo::loadImmediate(unsigned FrameReg, int64_t Imm,
321 const DebugLoc &DL,
322 unsigned &NewImm) const {
323 //
324 // given original instruction is:
325 // Instr rx, T[offset] where offset is too big.
326 //
327 // lo = offset & 0xFFFF
328 // hi = ((offset >> 16) + (lo >> 15)) & 0xFFFF;
329 //
330 // let T = temporary register
331 // li T, hi
332 // shl T, 16
333 // add T, Rx, T
334 //
335 RegScavenger rs;
336 int32_t lo = Imm & 0xFFFF;
337 NewImm = lo;
338 int Reg =0;
339 int SpReg = 0;
340
342 rs.backward(std::next(II));
343 //
344 // We need to know which registers can be used, in the case where there
345 // are not enough free registers. We exclude all registers that
346 // are used in the instruction that we are helping.
347 // // Consider all allocatable registers in the register class initially
348 BitVector Candidates =
349 RI.getAllocatableSet
350 (*II->getParent()->getParent(), &Mips::CPU16RegsRegClass);
351 // Exclude all the registers being used by the instruction.
352 for (MachineOperand &MO : II->operands()) {
353 if (MO.isReg() && MO.getReg() != 0 && !MO.isDef() &&
354 !MO.getReg().isVirtual())
355 Candidates.reset(MO.getReg());
356 }
357
358 // If the same register was used and defined in an instruction, then
359 // it will not be in the list of candidates.
360 //
361 // we need to analyze the instruction that we are helping.
362 // we need to know if it defines register x but register x is not
363 // present as an operand of the instruction. this tells
364 // whether the register is live before the instruction. if it's not
365 // then we don't need to save it in case there are no free registers.
366 int DefReg = 0;
367 for (MachineOperand &MO : II->operands()) {
368 if (MO.isReg() && MO.isDef()) {
369 DefReg = MO.getReg();
370 break;
371 }
372 }
373
374 BitVector Available = rs.getRegsAvailable(&Mips::CPU16RegsRegClass);
375 Available &= Candidates;
376 //
377 // we use T0 for the first register, if we need to save something away.
378 // we use T1 for the second register, if we need to save something away.
379 //
380 unsigned FirstRegSaved =0, SecondRegSaved=0;
381 unsigned FirstRegSavedTo = 0, SecondRegSavedTo = 0;
382
383 Reg = Available.find_first();
384
385 if (Reg == -1) {
386 Reg = Candidates.find_first();
387 Candidates.reset(Reg);
388 if (DefReg != Reg) {
389 FirstRegSaved = Reg;
390 FirstRegSavedTo = Mips::T0;
391 copyPhysReg(MBB, II, DL, FirstRegSavedTo, FirstRegSaved, true);
392 }
393 }
394 else
395 Available.reset(Reg);
396 BuildMI(MBB, II, DL, get(Mips::LwConstant32), Reg).addImm(Imm).addImm(-1);
397 NewImm = 0;
398 if (FrameReg == Mips::SP) {
399 SpReg = Available.find_first();
400 if (SpReg == -1) {
401 SpReg = Candidates.find_first();
402 // Candidates.reset(SpReg); // not really needed
403 if (DefReg!= SpReg) {
404 SecondRegSaved = SpReg;
405 SecondRegSavedTo = Mips::T1;
406 }
407 if (SecondRegSaved)
408 copyPhysReg(MBB, II, DL, SecondRegSavedTo, SecondRegSaved, true);
409 }
410 else
411 Available.reset(SpReg);
412 copyPhysReg(MBB, II, DL, SpReg, Mips::SP, false);
413 BuildMI(MBB, II, DL, get(Mips::AdduRxRyRz16), Reg)
414 .addReg(SpReg, RegState::Kill)
415 .addReg(Reg);
416 }
417 else
418 BuildMI(MBB, II, DL, get(Mips:: AdduRxRyRz16), Reg).addReg(FrameReg)
419 .addReg(Reg, RegState::Kill);
420 if (FirstRegSaved || SecondRegSaved) {
421 II = std::next(II);
422 if (FirstRegSaved)
423 copyPhysReg(MBB, II, DL, FirstRegSaved, FirstRegSavedTo, true);
424 if (SecondRegSaved)
425 copyPhysReg(MBB, II, DL, SecondRegSaved, SecondRegSavedTo, true);
426 }
427 return Reg;
428}
429
430unsigned Mips16InstrInfo::getAnalyzableBrOpc(unsigned Opc) const {
431 return (Opc == Mips::BeqzRxImmX16 || Opc == Mips::BimmX16 ||
432 Opc == Mips::Bimm16 ||
433 Opc == Mips::Bteqz16 || Opc == Mips::Btnez16 ||
434 Opc == Mips::BeqzRxImm16 || Opc == Mips::BnezRxImm16 ||
435 Opc == Mips::BnezRxImmX16 || Opc == Mips::BteqzX16 ||
436 Opc == Mips::BteqzT8CmpX16 || Opc == Mips::BteqzT8CmpiX16 ||
437 Opc == Mips::BteqzT8SltX16 || Opc == Mips::BteqzT8SltuX16 ||
438 Opc == Mips::BteqzT8SltiX16 || Opc == Mips::BteqzT8SltiuX16 ||
439 Opc == Mips::BtnezX16 || Opc == Mips::BtnezT8CmpX16 ||
440 Opc == Mips::BtnezT8CmpiX16 || Opc == Mips::BtnezT8SltX16 ||
441 Opc == Mips::BtnezT8SltuX16 || Opc == Mips::BtnezT8SltiX16 ||
442 Opc == Mips::BtnezT8SltiuX16 ) ? Opc : 0;
443}
444
445void Mips16InstrInfo::ExpandRetRA16(MachineBasicBlock &MBB,
447 unsigned Opc) const {
448 BuildMI(MBB, I, I->getDebugLoc(), get(Opc));
449}
450
451const MCInstrDesc &Mips16InstrInfo::AddiuSpImm(int64_t Imm) const {
452 if (validSpImm8(Imm))
453 return get(Mips::AddiuSpImm16);
454 else
455 return get(Mips::AddiuSpImmX16);
456}
457
459 (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, int64_t Imm) const {
460 DebugLoc DL;
461 BuildMI(MBB, I, DL, AddiuSpImm(Imm)).addImm(Imm);
462}
463
465 return new Mips16InstrInfo(STI);
466}
467
468bool Mips16InstrInfo::validImmediate(unsigned Opcode, unsigned Reg,
469 int64_t Amount) {
470 switch (Opcode) {
471 case Mips::LbRxRyOffMemX16:
472 case Mips::LbuRxRyOffMemX16:
473 case Mips::LhRxRyOffMemX16:
474 case Mips::LhuRxRyOffMemX16:
475 case Mips::SbRxRyOffMemX16:
476 case Mips::ShRxRyOffMemX16:
477 case Mips::LwRxRyOffMemX16:
478 case Mips::SwRxRyOffMemX16:
479 case Mips::SwRxSpImmX16:
480 case Mips::LwRxSpImmX16:
481 return isInt<16>(Amount);
482 case Mips::AddiuRxRyOffMemX16:
483 if ((Reg == Mips::PC) || (Reg == Mips::SP))
484 return isInt<16>(Amount);
485 return isInt<15>(Amount);
486 }
487 llvm_unreachable("unexpected Opcode in validImmediate");
488}
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file implements the BitVector class.
@ Available
We know the block is fully available. This is a fixpoint.
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition: MD5.cpp:58
unsigned const TargetRegisterInfo * TRI
static void addSaveRestoreRegs(MachineInstrBuilder &MIB, ArrayRef< CalleeSavedInfo > CSI, unsigned Flags=0)
uint64_t IntrinsicInst * II
This file declares the machine register scavenger class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
Definition: Value.cpp:469
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:168
BitVector & reset()
Definition: BitVector.h:392
int find_first() const
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
Definition: BitVector.h:300
A debug info location.
Definition: DebugLoc.h:33
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:198
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:33
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addFrameIndex(int Idx) const
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
Representation of each machine instruction.
Definition: MachineInstr.h:69
A description of a memory reference used in the backend.
@ MOLoad
The memory access reads data.
@ MOStore
The memory access writes data.
MachineOperand class - Representation of each machine instruction operand.
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot,...
bool expandPostRAPseudo(MachineInstr &MI) const override
static bool validImmediate(unsigned Opcode, unsigned Reg, int64_t Amount)
const MCInstrDesc & AddiuSpImm(int64_t Imm) const
void makeFrame(unsigned SP, int64_t FrameSize, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const
void BuildAddiuSpImm(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, int64_t Imm) const
void storeRegToStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override
unsigned getOppositeBranchOpc(unsigned Opc) const override
GetOppositeBranchOpc - Return the inverse of the specified opcode, e.g.
std::optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
If the specific machine instruction is a instruction that moves/copies value from one register to ano...
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot,...
static bool validSpImm8(int offset)
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
void restoreFrame(unsigned SP, int64_t FrameSize, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const
Mips16InstrInfo(const MipsSubtarget &STI)
void loadRegFromStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const override
unsigned loadImmediate(unsigned FrameReg, int64_t Imm, MachineBasicBlock &MBB, MachineBasicBlock::iterator II, const DebugLoc &DL, unsigned &NewImm) const
Emit a series of instructions to load an immediate.
void adjustStackPtr(unsigned SP, int64_t Amount, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
Adjust SP by Amount bytes.
const MipsRegisterInfo & getRegisterInfo() const override
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
MachineMemOperand * GetMemOperand(MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const
BitVector getReservedRegs(const MachineFunction &MF) const override
void enterBasicBlockEnd(MachineBasicBlock &MBB)
Start tracking liveness from the end of basic block MBB.
void backward()
Update internal register state and move MBB iterator backwards.
BitVector getRegsAvailable(const TargetRegisterClass *RC)
Return all available registers in the register class in Mask.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Define
Register definition.
@ Kill
The last use of a register.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:480
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
unsigned getKillRegState(bool B)
const MipsInstrInfo * createMips16InstrInfo(const MipsSubtarget &STI)
Create MipsInstrInfo objects.