LLVM 24.0.0git
MipsInstrInfo.cpp
Go to the documentation of this file.
1//===- MipsInstrInfo.cpp - Mips 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 Mips implementation of the TargetInstrInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#include "MipsInstrInfo.h"
16#include "Mips.h"
17#include "MipsSubtarget.h"
28#include "llvm/IR/DebugLoc.h"
30#include "llvm/MC/MCInstrDesc.h"
32#include <cassert>
33
34using namespace llvm;
35
36#define GET_INSTRINFO_CTOR_DTOR
37#include "MipsGenInstrInfo.inc"
38
39// Pin the vtable to this file.
40void MipsInstrInfo::anchor() {}
41
43 const MipsRegisterInfo &RI, unsigned UncondBr)
44 : MipsGenInstrInfo(STI, RI, Mips::ADJCALLSTACKDOWN, Mips::ADJCALLSTACKUP),
45 Subtarget(STI), UncondBrOpc(UncondBr) {}
46
49 return Subtarget.getABI().ArePtrs64bit() ? &Mips::GPR64RegClass
50 : &Mips::GPR32RegClass;
51}
52
54 if (STI.inMips16Mode())
55 return createMips16InstrInfo(STI);
56
57 return createMipsSEInstrInfo(STI);
58}
59
61 return op.isImm() && op.getImm() == 0;
62}
63
65 return MCInstBuilder(Mips::SLL)
66 .addReg(Mips::ZERO)
67 .addReg(Mips::ZERO)
68 .addImm(0);
69}
70
71/// insertNoop - If data hazard condition is found insert the target nop
72/// instruction.
79
82 DebugLoc DL) const {
83 assert(!Subtarget.inMips16Mode() &&
84 "insertNop does not support MIPS16e mode at this time");
85 const unsigned MMOpc =
86 Subtarget.hasMips32r6() ? Mips::SLL_MMR6 : Mips::SLL_MM;
87 const unsigned Opc =
88 Subtarget.inMicroMipsMode() ? MMOpc : (unsigned)Mips::SLL;
89 return BuildMI(MBB, MI, DL, get(Opc), Mips::ZERO)
90 .addReg(Mips::ZERO)
91 .addImm(0);
92}
93
96 MachineMemOperand::Flags Flags) const {
97 MachineFunction &MF = *MBB.getParent();
99
101 Flags, MFI.getObjectSize(FI),
102 MFI.getObjectAlign(FI));
103}
104
105//===----------------------------------------------------------------------===//
106// Branch Analysis
107//===----------------------------------------------------------------------===//
108
109void MipsInstrInfo::AnalyzeCondBr(const MachineInstr *Inst, unsigned Opc,
112 assert(getAnalyzableBrOpc(Opc) && "Not an analyzable branch");
113 int NumOp = Inst->getNumExplicitOperands();
114
115 // for both int and fp branches, the last explicit operand is the
116 // MBB.
117 BB = Inst->getOperand(NumOp-1).getMBB();
119
120 for (int i = 0; i < NumOp-1; i++)
121 Cond.push_back(Inst->getOperand(i));
122}
123
126 MachineBasicBlock *&FBB,
128 bool AllowModify) const {
130 BranchType BT = analyzeBranch(MBB, TBB, FBB, Cond, AllowModify, BranchInstrs);
131
132 return (BT == BT_None) || (BT == BT_Indirect);
133}
134
135void MipsInstrInfo::BuildCondBr(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
136 const DebugLoc &DL,
138 unsigned Opc = Cond[0].getImm();
139 const MCInstrDesc &MCID = get(Opc);
141
142 for (unsigned i = 1; i < Cond.size(); ++i) {
143 assert((Cond[i].isImm() || Cond[i].isReg()) &&
144 "Cannot copy operand for conditional branch!");
145 MIB.add(Cond[i]);
146 }
147 MIB.addMBB(TBB);
149}
150
155 const DebugLoc &DL,
156 int *BytesAdded) const {
157 // Shouldn't be a fall through.
158 assert(TBB && "insertBranch must not be told to insert a fallthrough");
159 assert(!BytesAdded && "code size not handled");
160
161 // # of condition operands:
162 // Unconditional branches: 0
163 // Floating point branches: 1 (opc)
164 // Int BranchZero: 2 (opc, reg)
165 // Int Branch: 3 (opc, reg0, reg1)
166 assert((Cond.size() <= 3) &&
167 "# of Mips branch conditions must be <= 3!");
168
169 // Two-way Conditional branch.
170 if (FBB) {
171 BuildCondBr(MBB, TBB, DL, Cond);
173 .addMBB(FBB)
175 return 2;
176 }
177
178 // One way branch.
179 // Unconditional branch.
180 if (Cond.empty()) {
182 .addMBB(TBB)
184 } else {
185 // Conditional branch.
186 BuildCondBr(MBB, TBB, DL, Cond);
187 }
188 return 1;
189}
190
192 int *BytesRemoved) const {
193 assert(!BytesRemoved && "code size not handled");
194
195 MachineBasicBlock::reverse_iterator I = MBB.rbegin(), REnd = MBB.rend();
196 unsigned removed = 0;
197
198 // Up to 2 branches are removed.
199 // Note that indirect branches are not removed.
200 while (I != REnd && removed < 2) {
201 // Skip past debug instructions.
202 if (I->isDebugInstr()) {
203 ++I;
204 continue;
205 }
206 if (!getAnalyzableBrOpc(I->getOpcode()))
207 break;
208 // Remove the branch.
209 I->eraseFromParent();
210 I = MBB.rbegin();
211 ++removed;
212 }
213
214 return removed;
215}
216
217/// reverseBranchCondition - Return the inverse opcode of the
218/// specified Branch instruction.
221 assert( (Cond.size() && Cond.size() <= 3) &&
222 "Invalid Mips branch condition!");
223 Cond[0].setImm(getOppositeBranchOpc(Cond[0].getImm()));
224 return false;
225}
226
229 SmallVectorImpl<MachineOperand> &Cond, bool AllowModify,
230 SmallVectorImpl<MachineInstr *> &BranchInstrs) const {
231 MachineBasicBlock::reverse_iterator I = MBB.rbegin(), REnd = MBB.rend();
232
233 // Skip all the debug instructions.
234 while (I != REnd && I->isDebugInstr())
235 ++I;
236
237 if (I == REnd || !isUnpredicatedTerminator(*I)) {
238 // This block ends with no branches (it just falls through to its succ).
239 // Leave TBB/FBB null.
240 TBB = FBB = nullptr;
241 return BT_NoBranch;
242 }
243
244 MachineInstr *LastInst = &*I;
245 unsigned LastOpc = LastInst->getOpcode();
246 BranchInstrs.push_back(LastInst);
247
248 // Not an analyzable branch (e.g., indirect jump).
249 if (!getAnalyzableBrOpc(LastOpc))
250 return LastInst->isIndirectBranch() ? BT_Indirect : BT_None;
251
252 // Get the second to last instruction in the block.
253 unsigned SecondLastOpc = 0;
254 MachineInstr *SecondLastInst = nullptr;
255
256 // Skip past any debug instruction to see if the second last actual
257 // is a branch.
258 ++I;
259 while (I != REnd && I->isDebugInstr())
260 ++I;
261
262 if (I != REnd) {
263 SecondLastInst = &*I;
264 SecondLastOpc = getAnalyzableBrOpc(SecondLastInst->getOpcode());
265
266 // Not an analyzable branch (must be an indirect jump).
267 if (isUnpredicatedTerminator(*SecondLastInst) && !SecondLastOpc)
268 return BT_None;
269 }
270
271 // If there is only one terminator instruction, process it.
272 if (!SecondLastOpc) {
273 // Unconditional branch.
274 if (LastInst->isUnconditionalBranch()) {
275 TBB = LastInst->getOperand(0).getMBB();
276 return BT_Uncond;
277 }
278
279 // Conditional branch
280 AnalyzeCondBr(LastInst, LastOpc, TBB, Cond);
281 return BT_Cond;
282 }
283
284 // If we reached here, there are two branches.
285 // If there are three terminators, we don't know what sort of block this is.
286 if (++I != REnd && isUnpredicatedTerminator(*I))
287 return BT_None;
288
289 BranchInstrs.insert(BranchInstrs.begin(), SecondLastInst);
290
291 // If second to last instruction is an unconditional branch,
292 // analyze it and remove the last instruction.
293 if (SecondLastInst->isUnconditionalBranch()) {
294 // Return if the last instruction cannot be removed.
295 if (!AllowModify)
296 return BT_None;
297
298 TBB = SecondLastInst->getOperand(0).getMBB();
299 LastInst->eraseFromParent();
300 BranchInstrs.pop_back();
301 return BT_Uncond;
302 }
303
304 // Conditional branch followed by an unconditional branch.
305 // The last one must be unconditional.
306 if (!LastInst->isUnconditionalBranch())
307 return BT_None;
308
309 AnalyzeCondBr(SecondLastInst, SecondLastOpc, TBB, Cond);
310 FBB = LastInst->getOperand(0).getMBB();
311
312 return BT_CondUncond;
313}
314
316 int64_t BrOffset) const {
317 switch (BranchOpc) {
318 case Mips::B:
319 case Mips::BAL:
320 case Mips::BAL_BR:
321 case Mips::BAL_BR_MM:
322 case Mips::BC1F:
323 case Mips::BC1FL:
324 case Mips::BC1T:
325 case Mips::BC1TL:
326 case Mips::BEQ: case Mips::BEQ64:
327 case Mips::BEQL:
328 case Mips::BGEZ: case Mips::BGEZ64:
329 case Mips::BGEZL:
330 case Mips::BGEZAL:
331 case Mips::BGEZALL:
332 case Mips::BGTZ: case Mips::BGTZ64:
333 case Mips::BGTZL:
334 case Mips::BLEZ: case Mips::BLEZ64:
335 case Mips::BLEZL:
336 case Mips::BLTZ: case Mips::BLTZ64:
337 case Mips::BLTZL:
338 case Mips::BLTZAL:
339 case Mips::BLTZALL:
340 case Mips::BNE: case Mips::BNE64:
341 case Mips::BNEL:
342 return isInt<18>(BrOffset);
343
344 // microMIPSr3 branches
345 case Mips::B_MM:
346 case Mips::BC1F_MM:
347 case Mips::BC1T_MM:
348 case Mips::BEQ_MM:
349 case Mips::BGEZ_MM:
350 case Mips::BGEZAL_MM:
351 case Mips::BGTZ_MM:
352 case Mips::BLEZ_MM:
353 case Mips::BLTZ_MM:
354 case Mips::BLTZAL_MM:
355 case Mips::BNE_MM:
356 case Mips::BEQZC_MM:
357 case Mips::BNEZC_MM:
358 return isInt<17>(BrOffset);
359
360 // microMIPSR3 short branches.
361 case Mips::B16_MM:
362 return isInt<11>(BrOffset);
363
364 case Mips::BEQZ16_MM:
365 case Mips::BNEZ16_MM:
366 return isInt<8>(BrOffset);
367
368 // MIPSR6 branches.
369 case Mips::BALC:
370 case Mips::BC:
371 return isInt<28>(BrOffset);
372
373 case Mips::BC1EQZ:
374 case Mips::BC1NEZ:
375 case Mips::BC2EQZ:
376 case Mips::BC2NEZ:
377 case Mips::BEQC: case Mips::BEQC64:
378 case Mips::BNEC: case Mips::BNEC64:
379 case Mips::BGEC: case Mips::BGEC64:
380 case Mips::BGEUC: case Mips::BGEUC64:
381 case Mips::BGEZC: case Mips::BGEZC64:
382 case Mips::BGTZC: case Mips::BGTZC64:
383 case Mips::BLEZC: case Mips::BLEZC64:
384 case Mips::BLTC: case Mips::BLTC64:
385 case Mips::BLTUC: case Mips::BLTUC64:
386 case Mips::BLTZC: case Mips::BLTZC64:
387 case Mips::BNVC:
388 case Mips::BOVC:
389 case Mips::BGEZALC:
390 case Mips::BEQZALC:
391 case Mips::BGTZALC:
392 case Mips::BLEZALC:
393 case Mips::BLTZALC:
394 case Mips::BNEZALC:
395 return isInt<18>(BrOffset);
396
397 case Mips::BEQZC: case Mips::BEQZC64:
398 case Mips::BNEZC: case Mips::BNEZC64:
399 return isInt<23>(BrOffset);
400
401 // microMIPSR6 branches
402 case Mips::BC16_MMR6:
403 return isInt<11>(BrOffset);
404
405 case Mips::BEQZC16_MMR6:
406 case Mips::BNEZC16_MMR6:
407 return isInt<8>(BrOffset);
408
409 case Mips::BALC_MMR6:
410 case Mips::BC_MMR6:
411 return isInt<27>(BrOffset);
412
413 case Mips::BC1EQZC_MMR6:
414 case Mips::BC1NEZC_MMR6:
415 case Mips::BC2EQZC_MMR6:
416 case Mips::BC2NEZC_MMR6:
417 case Mips::BGEZALC_MMR6:
418 case Mips::BEQZALC_MMR6:
419 case Mips::BGTZALC_MMR6:
420 case Mips::BLEZALC_MMR6:
421 case Mips::BLTZALC_MMR6:
422 case Mips::BNEZALC_MMR6:
423 case Mips::BNVC_MMR6:
424 case Mips::BOVC_MMR6:
425 return isInt<17>(BrOffset);
426
427 case Mips::BEQC_MMR6:
428 case Mips::BNEC_MMR6:
429 case Mips::BGEC_MMR6:
430 case Mips::BGEUC_MMR6:
431 case Mips::BGEZC_MMR6:
432 case Mips::BGTZC_MMR6:
433 case Mips::BLEZC_MMR6:
434 case Mips::BLTC_MMR6:
435 case Mips::BLTUC_MMR6:
436 case Mips::BLTZC_MMR6:
437 return isInt<18>(BrOffset);
438
439 case Mips::BEQZC_MMR6:
440 case Mips::BNEZC_MMR6:
441 return isInt<23>(BrOffset);
442
443 // DSP branches.
444 case Mips::BPOSGE32:
445 return isInt<18>(BrOffset);
446 case Mips::BPOSGE32_MM:
447 case Mips::BPOSGE32C_MMR3:
448 return isInt<17>(BrOffset);
449
450 // cnMIPS branches.
451 case Mips::BBIT0:
452 case Mips::BBIT032:
453 case Mips::BBIT1:
454 case Mips::BBIT132:
455 return isInt<18>(BrOffset);
456
457 // MSA branches.
458 case Mips::BZ_B:
459 case Mips::BZ_H:
460 case Mips::BZ_W:
461 case Mips::BZ_D:
462 case Mips::BZ_V:
463 case Mips::BNZ_B:
464 case Mips::BNZ_H:
465 case Mips::BNZ_W:
466 case Mips::BNZ_D:
467 case Mips::BNZ_V:
468 return isInt<18>(BrOffset);
469 }
470
471 llvm_unreachable("Unknown branch instruction!");
472}
473
474/// Return the corresponding compact (no delay slot) form of a branch.
476 const MachineBasicBlock::iterator I) const {
477 unsigned Opcode = I->getOpcode();
478 bool canUseShortMicroMipsCTI = false;
479
480 if (Subtarget.inMicroMipsMode()) {
481 switch (Opcode) {
482 case Mips::BNE:
483 case Mips::BNE_MM:
484 case Mips::BEQ:
485 case Mips::BEQ_MM:
486 // microMIPS has NE,EQ branches that do not have delay slots provided one
487 // of the operands is zero.
488 if (I->getOperand(1).getReg() == Subtarget.getABI().GetZeroReg())
489 canUseShortMicroMipsCTI = true;
490 break;
491 // For microMIPS the PseudoReturn and PseudoIndirectBranch are always
492 // expanded to JR_MM, so they can be replaced with JRC16_MM.
493 case Mips::JR:
494 case Mips::PseudoReturn:
495 case Mips::PseudoIndirectBranch:
496 canUseShortMicroMipsCTI = true;
497 break;
498 }
499 }
500
501 // MIPSR6 forbids both operands being the zero register.
502 if (Subtarget.hasMips32r6() && (I->getNumOperands() > 1) &&
503 (I->getOperand(0).isReg() &&
504 (I->getOperand(0).getReg() == Mips::ZERO ||
505 I->getOperand(0).getReg() == Mips::ZERO_64)) &&
506 (I->getOperand(1).isReg() &&
507 (I->getOperand(1).getReg() == Mips::ZERO ||
508 I->getOperand(1).getReg() == Mips::ZERO_64)))
509 return 0;
510
511 if (Subtarget.hasMips32r6() || canUseShortMicroMipsCTI) {
512 switch (Opcode) {
513 case Mips::B:
514 return Mips::BC;
515 case Mips::BAL:
516 return Mips::BALC;
517 case Mips::BEQ:
518 case Mips::BEQ_MM:
519 if (canUseShortMicroMipsCTI)
520 return Mips::BEQZC_MM;
521 else if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
522 return 0;
523 return Mips::BEQC;
524 case Mips::BNE:
525 case Mips::BNE_MM:
526 if (canUseShortMicroMipsCTI)
527 return Mips::BNEZC_MM;
528 else if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
529 return 0;
530 return Mips::BNEC;
531 case Mips::BGE:
532 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
533 return 0;
534 return Mips::BGEC;
535 case Mips::BGEU:
536 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
537 return 0;
538 return Mips::BGEUC;
539 case Mips::BGEZ:
540 return Mips::BGEZC;
541 case Mips::BGTZ:
542 return Mips::BGTZC;
543 case Mips::BLEZ:
544 return Mips::BLEZC;
545 case Mips::BLT:
546 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
547 return 0;
548 return Mips::BLTC;
549 case Mips::BLTU:
550 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
551 return 0;
552 return Mips::BLTUC;
553 case Mips::BLTZ:
554 return Mips::BLTZC;
555 case Mips::BEQ64:
556 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
557 return 0;
558 return Mips::BEQC64;
559 case Mips::BNE64:
560 if (I->getOperand(0).getReg() == I->getOperand(1).getReg())
561 return 0;
562 return Mips::BNEC64;
563 case Mips::BGTZ64:
564 return Mips::BGTZC64;
565 case Mips::BGEZ64:
566 return Mips::BGEZC64;
567 case Mips::BLTZ64:
568 return Mips::BLTZC64;
569 case Mips::BLEZ64:
570 return Mips::BLEZC64;
571 // For MIPSR6, the instruction 'jic' can be used for these cases. Some
572 // tools will accept 'jrc reg' as an alias for 'jic 0, $reg'.
573 case Mips::JR:
574 case Mips::PseudoIndirectBranchR6:
575 case Mips::PseudoReturn:
576 case Mips::TAILCALLR6REG:
577 if (canUseShortMicroMipsCTI)
578 return Mips::JRC16_MM;
579 return Mips::JIC;
580 case Mips::JALRPseudo:
581 return Mips::JIALC;
582 case Mips::JR64:
583 case Mips::PseudoIndirectBranch64R6:
584 case Mips::PseudoReturn64:
585 case Mips::TAILCALL64R6REG:
586 return Mips::JIC64;
587 case Mips::JALR64Pseudo:
588 return Mips::JIALC64;
589 default:
590 return 0;
591 }
592 }
593
594 return 0;
595}
596
598 if (IsDIVMULT(MI.getOpcode()))
599 return false;
600
601 return true;
602}
603
604/// Predicate for distingushing between control transfer instructions and all
605/// other instructions for handling forbidden slots. Consider inline assembly
606/// as unsafe as well.
608 if (MI.isInlineAsm())
609 return false;
610
611 return (MI.getDesc().TSFlags & MipsII::IsCTI) == 0;
612}
613
615 const MachineInstr &FPUMI) const {
616 if (MIInSlot.isInlineAsm())
617 return false;
618
619 if (HasFPUDelaySlot(MIInSlot))
620 return false;
621
622 switch (MIInSlot.getOpcode()) {
623 case Mips::BC1F:
624 case Mips::BC1FL:
625 case Mips::BC1T:
626 case Mips::BC1TL:
627 return false;
628 }
629
630 for (const MachineOperand &Op : FPUMI.defs()) {
631 if (!Op.isReg())
632 continue;
633
634 bool Reads, Writes;
635 std::tie(Reads, Writes) = MIInSlot.readsWritesVirtualRegister(Op.getReg());
636
637 if (Reads || Writes)
638 return false;
639 }
640
641 return true;
642}
643
644/// Predicate for distinguishing instructions that are hazardous in a load delay
645/// slot. Consider inline assembly as unsafe as well.
647 const MachineInstr &LoadMI) const {
648 if (MIInSlot.isInlineAsm())
649 return false;
650
651 return !llvm::any_of(LoadMI.defs(), [&](const MachineOperand &Op) {
652 return Op.isReg() && MIInSlot.readsRegister(Op.getReg(), /*TRI=*/nullptr) &&
653 !MIInSlot.hasRegisterImplicitUseOperand(Op.getReg());
654 });
655}
656
658 if (IsMFLOMFHI(MI.getOpcode()))
659 return true;
660
661 return false;
662}
663
664/// Predicate for distingushing instructions that have forbidden slots.
666 return (MI.getDesc().TSFlags & MipsII::HasForbiddenSlot) != 0;
667}
668
669/// Predicate for distingushing instructions that have FPU delay slots.
671 switch (MI.getOpcode()) {
672 case Mips::MTC1:
673 case Mips::MFC1:
674 case Mips::MTC1_D64:
675 case Mips::MFC1_D64:
676 case Mips::DMTC1:
677 case Mips::DMFC1:
678 case Mips::FCMP_S32:
679 case Mips::FCMP_D32:
680 case Mips::FCMP_D64:
681 return true;
682
683 default:
684 return false;
685 }
686}
687
688/// Predicate for distingushing instructions that have load delay slots.
690 switch (MI.getOpcode()) {
691 case Mips::LB:
692 case Mips::LBu:
693 case Mips::LH:
694 case Mips::LHu:
695 case Mips::LW:
696 case Mips::LWR:
697 case Mips::LWL:
698 // On MIPS-I, the only float load there is; the rest came with later ISAs.
699 case Mips::LWC1:
700 return true;
701 default:
702 return false;
703 }
704}
705
707 const unsigned Opcode = MI.getOpcode();
708 switch (Opcode) {
709 default:
710 break;
711 case Mips::ADDiu:
712 case Mips::ADDiu_MM:
713 case Mips::DADDiu:
714 return ((MI.getOperand(2).isImm() && MI.getOperand(2).getImm() == 0) ||
715 (MI.getOperand(1).isReg() &&
716 (MI.getOperand(1).getReg() == Mips::ZERO ||
717 MI.getOperand(1).getReg() == Mips::ZERO_64)));
718 }
719 return MI.isAsCheapAsAMove();
720}
721
722/// Return the number of bytes of code the specified instruction may be.
724 switch (MI.getOpcode()) {
725 default:
726 // Handle non-finalized bundle.
727 if (MI.isBundledWithSucc())
728 return MI.getDesc().getSize() + getInstBundleSize(MI);
729 if (MI.hasDelaySlot()) {
730 // instr + 1 nop
731 return MI.getDesc().getSize() + 4;
732 }
733 return MI.getDesc().getSize();
734 case TargetOpcode::INLINEASM:
735 case TargetOpcode::INLINEASM_BR: { // Inline Asm: Variable size.
736 const MachineFunction *MF = MI.getParent()->getParent();
737 const char *AsmStr = MI.getOperand(0).getSymbolName();
738 return getInlineAsmLength(AsmStr, MF->getTarget().getMCAsmInfo());
739 }
740 case TargetOpcode::BUNDLE:
741 return getInstBundleSize(MI);
742 case TargetOpcode::PATCHABLE_FUNCTION_ENTER:
743 case TargetOpcode::PATCHABLE_FUNCTION_EXIT:
744 case TargetOpcode::PATCHABLE_TAIL_CALL:
745 // Size of xray sled
746 if (Subtarget.isGP64bit()) {
747 // beq + 15 nops
748 return 16 * 4;
749 } else {
750 // beq + 11 nops + addiu
751 return 13 * 4;
752 }
753 case Mips::CONSTPOOL_ENTRY:
754 // If this machine instr is a constant pool entry, its size is recorded as
755 // operand #2.
756 return MI.getOperand(2).getImm();
757 }
758}
759
764
765 // Certain branches have two forms: e.g beq $1, $zero, dest vs beqz $1, dest
766 // Pick the zero form of the branch for readable assembly and for greater
767 // branch distance in non-microMIPS mode.
768 // Additional MIPSR6 does not permit the use of register $zero for compact
769 // branches.
770 // FIXME: Certain atomic sequences on mips64 generate 32bit references to
771 // Mips::ZERO, which is incorrect. This test should be updated to use
772 // Subtarget.getABI().GetZeroReg() when those atomic sequences and others
773 // are fixed.
774 int ZeroOperandPosition = -1;
775 bool BranchWithZeroOperand = false;
776 if (I->isBranch() && !I->isPseudo()) {
777 auto TRI = I->getParent()->getParent()->getSubtarget().getRegisterInfo();
778 ZeroOperandPosition = I->findRegisterUseOperandIdx(Mips::ZERO, TRI, false);
779 BranchWithZeroOperand = ZeroOperandPosition != -1;
780 }
781
782 if (BranchWithZeroOperand) {
783 switch (NewOpc) {
784 case Mips::BEQC:
785 NewOpc = Mips::BEQZC;
786 break;
787 case Mips::BNEC:
788 NewOpc = Mips::BNEZC;
789 break;
790 case Mips::BGEC:
791 NewOpc = Mips::BGEZC;
792 break;
793 case Mips::BLTC:
794 NewOpc = Mips::BLTZC;
795 break;
796 case Mips::BEQC64:
797 NewOpc = Mips::BEQZC64;
798 break;
799 case Mips::BNEC64:
800 NewOpc = Mips::BNEZC64;
801 break;
802 }
803 }
804
805 MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), get(NewOpc));
806
807 // For MIPSR6 JI*C requires an immediate 0 as an operand, JIALC(64) an
808 // immediate 0 as an operand and requires the removal of it's implicit-def %ra
809 // implicit operand as copying the implicit operations of the instructio we're
810 // looking at will give us the correct flags.
811 if (NewOpc == Mips::JIC || NewOpc == Mips::JIALC || NewOpc == Mips::JIC64 ||
812 NewOpc == Mips::JIALC64) {
813
814 if (NewOpc == Mips::JIALC || NewOpc == Mips::JIALC64)
815 MIB->removeOperand(0);
816
817 for (unsigned J = 0, E = I->getDesc().getNumOperands(); J < E; ++J) {
818 MIB.add(I->getOperand(J));
819 }
820
821 MIB.addImm(0);
822
823 // If I has an MCSymbol operand (used by asm printer, to emit R_MIPS_JALR),
824 // add it to the new instruction.
825 for (unsigned J = I->getDesc().getNumOperands(), E = I->getNumOperands();
826 J < E; ++J) {
827 const MachineOperand &MO = I->getOperand(J);
828 if (MO.isMCSymbol() && (MO.getTargetFlags() & MipsII::MO_JALR))
830 }
831
832
833 } else {
834 for (unsigned J = 0, E = I->getDesc().getNumOperands(); J < E; ++J) {
835 if (BranchWithZeroOperand && (unsigned)ZeroOperandPosition == J)
836 continue;
837
838 MIB.add(I->getOperand(J));
839 }
840 }
841
842 MIB.copyImplicitOps(*I);
843 MIB.cloneMemRefs(*I);
844 return MIB;
845}
846
848 unsigned &SrcOpIdx1,
849 unsigned &SrcOpIdx2) const {
850 assert(!MI.isBundle() &&
851 "TargetInstrInfo::findCommutedOpIndices() can't handle bundles");
852
853 const MCInstrDesc &MCID = MI.getDesc();
854 if (!MCID.isCommutable())
855 return false;
856
857 switch (MI.getOpcode()) {
858 case Mips::DPADD_U_H:
859 case Mips::DPADD_U_W:
860 case Mips::DPADD_U_D:
861 case Mips::DPADD_S_H:
862 case Mips::DPADD_S_W:
863 case Mips::DPADD_S_D:
864 // The first operand is both input and output, so it should not commute
865 if (!fixCommutedOpIndices(SrcOpIdx1, SrcOpIdx2, 2, 3))
866 return false;
867
868 if (!MI.getOperand(SrcOpIdx1).isReg() || !MI.getOperand(SrcOpIdx2).isReg())
869 return false;
870 return true;
871 }
872 return TargetInstrInfo::findCommutedOpIndices(MI, SrcOpIdx1, SrcOpIdx2);
873}
874
875// ins, ext, dext*, dins have the following constraints:
876// X <= pos < Y
877// X < size <= Y
878// X < pos+size <= Y
879//
880// dinsm and dinsu have the following constraints:
881// X <= pos < Y
882// X <= size <= Y
883// X < pos+size <= Y
884//
885// The callee of verifyInsExtInstruction however gives the bounds of
886// dins[um] like the other (d)ins (d)ext(um) instructions, so that this
887// function doesn't have to vary it's behaviour based on the instruction
888// being checked.
890 const int64_t PosLow, const int64_t PosHigh,
891 const int64_t SizeLow,
892 const int64_t SizeHigh,
893 const int64_t BothLow,
894 const int64_t BothHigh) {
895 MachineOperand MOPos = MI.getOperand(2);
896 if (!MOPos.isImm()) {
897 ErrInfo = "Position is not an immediate!";
898 return false;
899 }
900 int64_t Pos = MOPos.getImm();
901 if (!((PosLow <= Pos) && (Pos < PosHigh))) {
902 ErrInfo = "Position operand is out of range!";
903 return false;
904 }
905
906 MachineOperand MOSize = MI.getOperand(3);
907 if (!MOSize.isImm()) {
908 ErrInfo = "Size operand is not an immediate!";
909 return false;
910 }
911 int64_t Size = MOSize.getImm();
912 if (!((SizeLow < Size) && (Size <= SizeHigh))) {
913 ErrInfo = "Size operand is out of range!";
914 return false;
915 }
916
917 if (!((BothLow < (Pos + Size)) && ((Pos + Size) <= BothHigh))) {
918 ErrInfo = "Position + Size is out of range!";
919 return false;
920 }
921
922 return true;
923}
924
925// Perform target specific instruction verification.
927 StringRef &ErrInfo) const {
928 // Verify that ins and ext instructions are well formed.
929 switch (MI.getOpcode()) {
930 case Mips::EXT:
931 case Mips::EXT_MM:
932 case Mips::INS:
933 case Mips::INS_MM:
934 case Mips::DINS:
935 return verifyInsExtInstruction(MI, ErrInfo, 0, 32, 0, 32, 0, 32);
936 case Mips::DINSM:
937 // The ISA spec has a subtle difference between dinsm and dextm
938 // in that it says:
939 // 2 <= size <= 64 for 'dinsm' but 'dextm' has 32 < size <= 64.
940 // To make the bounds checks similar, the range 1 < size <= 64 is checked
941 // for 'dinsm'.
942 return verifyInsExtInstruction(MI, ErrInfo, 0, 32, 1, 64, 32, 64);
943 case Mips::DINSU:
944 // The ISA spec has a subtle difference between dinsu and dextu in that
945 // the size range of dinsu is specified as 1 <= size <= 32 whereas size
946 // for dextu is 0 < size <= 32. The range checked for dinsu here is
947 // 0 < size <= 32, which is equivalent and similar to dextu.
948 return verifyInsExtInstruction(MI, ErrInfo, 32, 64, 0, 32, 32, 64);
949 case Mips::DEXT:
950 return verifyInsExtInstruction(MI, ErrInfo, 0, 32, 0, 32, 0, 63);
951 case Mips::DEXTM:
952 return verifyInsExtInstruction(MI, ErrInfo, 0, 32, 32, 64, 32, 64);
953 case Mips::DEXTU:
954 return verifyInsExtInstruction(MI, ErrInfo, 32, 64, 0, 32, 32, 64);
955 case Mips::TAILCALLREG:
956 case Mips::PseudoIndirectBranch:
957 case Mips::JR:
958 case Mips::JR64:
959 case Mips::JALR:
960 case Mips::JALR64:
961 case Mips::JALRPseudo:
962 if (!Subtarget.useIndirectJumpsHazard())
963 return true;
964
965 ErrInfo = "invalid instruction when using jump guards!";
966 return false;
967 default:
968 return true;
969 }
970
971 return true;
972}
973
974std::pair<unsigned, unsigned>
976 return std::make_pair(TF, 0u);
977}
978
981 using namespace MipsII;
982
983 static const std::pair<unsigned, const char*> Flags[] = {
984 {MO_GOT, "mips-got"},
985 {MO_GOT_CALL, "mips-got-call"},
986 {MO_GPREL, "mips-gprel"},
987 {MO_ABS_HI, "mips-abs-hi"},
988 {MO_ABS_LO, "mips-abs-lo"},
989 {MO_TLSGD, "mips-tlsgd"},
990 {MO_TLSLDM, "mips-tlsldm"},
991 {MO_DTPREL_HI, "mips-dtprel-hi"},
992 {MO_DTPREL_LO, "mips-dtprel-lo"},
993 {MO_GOTTPREL, "mips-gottprel"},
994 {MO_TPREL_HI, "mips-tprel-hi"},
995 {MO_TPREL_LO, "mips-tprel-lo"},
996 {MO_GPOFF_HI, "mips-gpoff-hi"},
997 {MO_GPOFF_LO, "mips-gpoff-lo"},
998 {MO_GOT_DISP, "mips-got-disp"},
999 {MO_GOT_PAGE, "mips-got-page"},
1000 {MO_GOT_OFST, "mips-got-ofst"},
1001 {MO_HIGHER, "mips-higher"},
1002 {MO_HIGHEST, "mips-highest"},
1003 {MO_GOT_HI16, "mips-got-hi16"},
1004 {MO_GOT_LO16, "mips-got-lo16"},
1005 {MO_CALL_HI16, "mips-call-hi16"},
1006 {MO_CALL_LO16, "mips-call-lo16"},
1007 {MO_JALR, "mips-jalr"}
1008 };
1009 return ArrayRef(Flags);
1010}
1011
1012std::optional<ParamLoadedValue>
1014 DIExpression *Expr =
1015 DIExpression::get(MI.getMF()->getFunction().getContext(), {});
1016
1017 // TODO: Special MIPS instructions that need to be described separately.
1018 if (auto RegImm = isAddImmediate(MI, Reg)) {
1019 Register SrcReg = RegImm->Reg;
1020 int64_t Offset = RegImm->Imm;
1021 // When SrcReg is $zero, treat loaded value as immediate only.
1022 // Ex. $a2 = ADDiu $zero, 10
1023 if (SrcReg == Mips::ZERO || SrcReg == Mips::ZERO_64) {
1024 return ParamLoadedValue(MI.getOperand(2), Expr);
1025 }
1027 return ParamLoadedValue(MachineOperand::CreateReg(SrcReg, false), Expr);
1028 } else if (auto DestSrc = isCopyInstr(MI)) {
1029 const MachineFunction *MF = MI.getMF();
1031 Register DestReg = DestSrc->Destination->getReg();
1032 // TODO: Handle cases where the Reg is sub- or super-register of the
1033 // DestReg.
1034 if (TRI->isSuperRegister(Reg, DestReg) || TRI->isSubRegister(Reg, DestReg))
1035 return std::nullopt;
1036 }
1037
1039}
1040
1041std::optional<RegImmPair> MipsInstrInfo::isAddImmediate(const MachineInstr &MI,
1042 Register Reg) const {
1043 // TODO: Handle cases where Reg is a super- or sub-register of the
1044 // destination register.
1045 const MachineOperand &Op0 = MI.getOperand(0);
1046 if (!Op0.isReg() || Reg != Op0.getReg())
1047 return std::nullopt;
1048
1049 switch (MI.getOpcode()) {
1050 case Mips::ADDiu:
1051 case Mips::DADDiu: {
1052 const MachineOperand &Dop = MI.getOperand(0);
1053 const MachineOperand &Sop1 = MI.getOperand(1);
1054 const MachineOperand &Sop2 = MI.getOperand(2);
1055 // Value is sum of register and immediate. Immediate value could be
1056 // global string address which is not supported.
1057 if (Dop.isReg() && Sop1.isReg() && Sop2.isImm())
1058 return RegImmPair{Sop1.getReg(), Sop2.getImm()};
1059 // TODO: Handle case where Sop1 is a frame-index.
1060 }
1061 }
1062 return std::nullopt;
1063}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
BitTracker BT
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
#define op(i)
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
Register const TargetRegisterInfo * TRI
static bool isReg(const MCInst &MI, unsigned OpNo)
static bool verifyInsExtInstruction(const MachineInstr &MI, StringRef &ErrInfo, const int64_t PosLow, const int64_t PosHigh, const int64_t SizeLow, const int64_t SizeHigh, const int64_t BothLow, const int64_t BothHigh)
#define IsMFLOMFHI(instr)
Definition Mips.h:20
#define IsDIVMULT(instr)
Definition Mips.h:23
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
DWARF expression.
static LLVM_ABI DIExpression * prepend(const DIExpression *Expr, uint8_t Flags, int64_t Offset=0)
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value or/and an ...
A debug info location.
Definition DebugLoc.h:126
MCInstBuilder & addReg(MCRegister Reg)
Add a new register operand.
MCInstBuilder & addImm(int64_t Val)
Add a new integer immediate operand.
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Describe properties that are true of each instruction in the target description file.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition Metadata.h:1579
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
MachineInstrBundleIterator< MachineInstr > iterator
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, LLT MemTy, Align BaseAlignment, const MMOMetadata &Metadata=MMOMetadata(), SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned TargetFlags=0) const
const MachineInstrBuilder & cloneMemRefs(const MachineInstr &OtherMI) const
const MachineInstrBuilder & copyImplicitOps(const MachineInstr &OtherMI) const
Copy all the implicit operands from OtherMI onto this one.
Representation of each machine instruction.
mop_range defs()
Returns all explicit operands that are register definitions.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
LLVM_ABI std::pair< bool, bool > readsWritesVirtualRegister(Register Reg, SmallVectorImpl< unsigned > *Ops=nullptr) const
Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg.
bool isInlineAsm() const
LLVM_ABI unsigned getNumExplicitOperands() const
Returns the number of non-implicit operands.
bool isUnconditionalBranch(QueryType Type=AnyInBundle) const
Return true if this is a branch which always transfers control flow to some other block.
void setImplicitPhysRegDefsDead()
Mark the implicit physreg defs named by the instruction description as dead.
LLVM_ABI void removeOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with.
const MachineOperand & getOperand(unsigned i) const
LLVM_ABI MachineInstrBundleIterator< MachineInstr > eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
A description of a memory reference used in the backend.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
int64_t getImm() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineBasicBlock * getMBB() const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
unsigned getTargetFlags() const
static MachineOperand CreateImm(int64_t Val)
Register getReg() const
getReg - Returns the register number.
MCSymbol * getMCSymbol() const
static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
MCInst getNop() const override
bool SafeAfterMflo(const MachineInstr &MI) const
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
bool SafeInForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction can go in a forbidden slot.
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
Return the number of bytes of code the specified instruction may be.
MachineInstrBuilder insertNop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL) const
Insert an ISA appropriate nop.
bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override
Determine if the branch target is in range.
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Branch Analysis.
const MipsSubtarget & Subtarget
MachineMemOperand * GetMemOperand(MachineBasicBlock &MBB, int FI, MachineMemOperand::Flags Flags) const
MachineInstrBuilder genInstrWithNewOpc(unsigned NewOpc, MachineBasicBlock::iterator I) const
Create an instruction which has the same operands and memory operands as MI but has a new opcode.
bool HasForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction has a forbidden slot.
bool SafeInFPUDelaySlot(const MachineInstr &MIInSlot, const MachineInstr &FPUMI) const
Predicate to determine if an instruction can go in an FPU delay slot.
bool isZeroImm(const MachineOperand &op) const
unsigned getEquivalentCompactForm(const MachineBasicBlock::iterator I) const
Determine the opcode of a non-delay slot form for a branch if one exists.
bool SafeInLoadDelaySlot(const MachineInstr &MIInSlot, const MachineInstr &LoadMI) const
Predicate to determine if an instruction can go in a load delay slot.
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
reverseBranchCondition - Return the inverse opcode of the specified Branch instruction.
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
const TargetRegisterClass * getInlineAsmMemoryOperandRegClass(InlineAsm::ConstraintCode C) const override
std::optional< RegImmPair > isAddImmediate(const MachineInstr &MI, Register Reg) const override
bool HasFPUDelaySlot(const MachineInstr &MI) const
Predicate to determine if an instruction has an FPU delay slot.
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
Perform target specific instruction verification.
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
static const MipsInstrInfo * create(MipsSubtarget &STI)
bool IsMfloOrMfhi(const MachineInstr &MI) const
bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const override
std::optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const override
MipsInstrInfo(const MipsSubtarget &STI, const MipsRegisterInfo &RI, unsigned UncondBrOpc)
virtual unsigned getOppositeBranchOpc(unsigned Opc) const =0
bool HasLoadDelaySlot(const MachineInstr &MI) const
Predicate to determine if an instruction has a load delay slot.
bool isAsCheapAsAMove(const MachineInstr &MI) const override
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
void insertNoop(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
Insert nop instruction when hazard condition is found.
bool inMips16Mode() const
Wrapper class representing virtual and physical registers.
Definition Register.h:20
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
iterator insert(iterator I, T &&Elt)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
virtual bool findCommutedOpIndices(const MachineInstr &MI, unsigned &SrcOpIdx1, unsigned &SrcOpIdx2) const
Returns true iff the routine could find two commutable operands in the given machine instruction.
virtual std::optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const
Produce the expression describing the MI loading a value into the physical register Reg.
const MCAsmInfo & getMCAsmInfo() const
Return target specific asm information.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MipsII - This namespace holds all of the target specific flags that instruction info tracks.
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
Definition MathExtras.h:166
const MipsInstrInfo * createMipsSEInstrInfo(const MipsSubtarget &STI)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1762
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
const MipsInstrInfo * createMips16InstrInfo(const MipsSubtarget &STI)
Create MipsInstrInfo objects.
std::pair< MachineOperand, DIExpression * > ParamLoadedValue
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58
static LLVM_ABI MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
Used to describe a register and immediate addition.