1 //===- llvm/CodeGen/GlobalISel/RegisterBankInfo.cpp --------------*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 /// This file implements the RegisterBankInfo class.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/iterator_range.h"
17 #include "llvm/CodeGen/GlobalISel/RegisterBank.h"
18 #include "llvm/CodeGen/MachineBasicBlock.h"
19 #include "llvm/CodeGen/MachineFunction.h"
20 #include "llvm/CodeGen/MachineRegisterInfo.h"
21 #include "llvm/IR/Type.h"
22 #include "llvm/Support/Debug.h"
23 #include "llvm/Support/raw_ostream.h"
24 #include "llvm/Target/TargetInstrInfo.h"
25 #include "llvm/Target/TargetOpcodes.h"
26 #include "llvm/Target/TargetRegisterInfo.h"
27 #include "llvm/Target/TargetSubtargetInfo.h"
29 #include <algorithm> // For std::max.
31 #define DEBUG_TYPE "registerbankinfo"
35 const unsigned RegisterBankInfo::DefaultMappingID = UINT_MAX;
36 const unsigned RegisterBankInfo::InvalidMappingID = UINT_MAX - 1;
38 //------------------------------------------------------------------------------
39 // RegisterBankInfo implementation.
40 //------------------------------------------------------------------------------
41 RegisterBankInfo::RegisterBankInfo(unsigned NumRegBanks)
42 : NumRegBanks(NumRegBanks) {
43 RegBanks.reset(new RegisterBank[NumRegBanks]);
46 bool RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const {
47 DEBUG(for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
48 const RegisterBank &RegBank = getRegBank(Idx);
49 assert(Idx == RegBank.getID() &&
50 "ID does not match the index in the array");
51 dbgs() << "Verify " << RegBank << '\n';
52 assert(RegBank.verify(TRI) && "RegBank is invalid");
57 void RegisterBankInfo::createRegisterBank(unsigned ID, const char *Name) {
58 DEBUG(dbgs() << "Create register bank: " << ID << " with name \"" << Name
60 RegisterBank &RegBank = getRegBank(ID);
61 assert(RegBank.getID() == RegisterBank::InvalidID &&
62 "A register bank should be created only once");
67 void RegisterBankInfo::addRegBankCoverage(unsigned ID, unsigned RCId,
68 const TargetRegisterInfo &TRI,
69 bool AddTypeMapping) {
70 RegisterBank &RB = getRegBank(ID);
71 unsigned NbOfRegClasses = TRI.getNumRegClasses();
73 DEBUG(dbgs() << "Add coverage for: " << RB << '\n');
75 // Check if RB is underconstruction.
77 RB.ContainedRegClasses.resize(NbOfRegClasses);
78 else if (RB.covers(*TRI.getRegClass(RCId)))
79 // If RB already covers this register class, there is nothing
83 BitVector &Covered = RB.ContainedRegClasses;
84 SmallVector<unsigned, 8> WorkList;
86 WorkList.push_back(RCId);
89 unsigned &MaxSize = RB.Size;
91 unsigned RCId = WorkList.pop_back_val();
93 const TargetRegisterClass &CurRC = *TRI.getRegClass(RCId);
95 DEBUG(dbgs() << "Examine: " << TRI.getRegClassName(&CurRC)
96 << "(Size*8: " << (CurRC.getSize() * 8) << ")\n");
98 // Remember the biggest size in bits.
99 MaxSize = std::max(MaxSize, CurRC.getSize() * 8);
101 // If we have been asked to record the type supported by this
102 // register bank, do it now.
104 for (MVT::SimpleValueType SVT :
105 make_range(CurRC.vt_begin(), CurRC.vt_end()))
106 recordRegBankForType(getRegBank(ID), SVT);
108 // Walk through all sub register classes and push them into the worklist.
110 for (BitMaskClassIterator It(CurRC.getSubClassMask(), TRI); It.isValid();
112 unsigned SubRCId = It.getID();
113 if (!Covered.test(SubRCId)) {
115 DEBUG(dbgs() << " Enqueue sub-class: ");
116 DEBUG(dbgs() << TRI.getRegClassName(TRI.getRegClass(SubRCId)) << ", ");
117 WorkList.push_back(SubRCId);
118 // Remember that we saw the sub class.
119 Covered.set(SubRCId);
124 DEBUG(dbgs() << '\n');
126 // Push also all the register classes that can be accessed via a
127 // subreg index, i.e., its subreg-class (which is different than
130 // Note: It would probably be faster to go the other way around
131 // and have this method add only super classes, since this
132 // information is available in a more efficient way. However, it
133 // feels less natural for the client of this APIs plus we will
134 // TableGen the whole bitset at some point, so compile time for
135 // the initialization is not very important.
137 for (unsigned SubRCId = 0; SubRCId < NbOfRegClasses; ++SubRCId) {
138 if (Covered.test(SubRCId))
141 const TargetRegisterClass *SubRC = TRI.getRegClass(SubRCId);
142 for (SuperRegClassIterator SuperRCIt(SubRC, &TRI); SuperRCIt.isValid();
146 for (BitMaskClassIterator It(SuperRCIt.getMask(), TRI); It.isValid();
148 unsigned SuperRCId = It.getID();
149 if (SuperRCId == RCId) {
151 DEBUG(dbgs() << " Enqueue subreg-class: ");
152 DEBUG(dbgs() << TRI.getRegClassName(SubRC) << ", ");
153 WorkList.push_back(SubRCId);
154 // Remember that we saw the sub class.
155 Covered.set(SubRCId);
164 DEBUG(dbgs() << '\n');
165 } while (!WorkList.empty());
169 RegisterBankInfo::getRegBank(unsigned Reg, const MachineRegisterInfo &MRI,
170 const TargetRegisterInfo &TRI) const {
171 if (TargetRegisterInfo::isPhysicalRegister(Reg))
172 return &getRegBankFromRegClass(*TRI.getMinimalPhysRegClass(Reg));
174 assert(Reg && "NoRegister does not have a register bank");
175 const RegClassOrRegBank &RegClassOrBank = MRI.getRegClassOrRegBank(Reg);
176 if (RegClassOrBank.is<const RegisterBank *>())
177 return RegClassOrBank.get<const RegisterBank *>();
178 const TargetRegisterClass *RC =
179 RegClassOrBank.get<const TargetRegisterClass *>();
181 return &getRegBankFromRegClass(*RC);
185 const RegisterBank *RegisterBankInfo::getRegBankFromConstraints(
186 const MachineInstr &MI, unsigned OpIdx, const TargetInstrInfo &TII,
187 const TargetRegisterInfo &TRI) const {
188 // The mapping of the registers may be available via the
189 // register class constraints.
190 const TargetRegisterClass *RC = MI.getRegClassConstraint(OpIdx, &TII, &TRI);
195 const RegisterBank &RegBank = getRegBankFromRegClass(*RC);
196 // Sanity check that the target properly implemented getRegBankFromRegClass.
197 assert(RegBank.covers(*RC) &&
198 "The mapping of the register bank does not make sense");
202 RegisterBankInfo::InstructionMapping
203 RegisterBankInfo::getInstrMappingImpl(const MachineInstr &MI) const {
204 RegisterBankInfo::InstructionMapping Mapping(DefaultMappingID, /*Cost*/ 1,
205 MI.getNumOperands());
206 const MachineFunction &MF = *MI.getParent()->getParent();
207 const TargetSubtargetInfo &STI = MF.getSubtarget();
208 const TargetRegisterInfo &TRI = *STI.getRegisterInfo();
209 const MachineRegisterInfo &MRI = MF.getRegInfo();
210 // We may need to query the instruction encoding to guess the mapping.
211 const TargetInstrInfo &TII = *STI.getInstrInfo();
213 // Before doing anything complicated check if the mapping is not
214 // directly available.
215 bool CompleteMapping = true;
216 // For copies we want to walk over the operands and try to find one
217 // that has a register bank.
218 bool isCopyLike = MI.isCopy() || MI.isPHI();
219 // Remember the register bank for reuse for copy-like instructions.
220 const RegisterBank *RegBank = nullptr;
221 // Remember the size of the register for reuse for copy-like instructions.
222 unsigned RegSize = 0;
223 for (unsigned OpIdx = 0, End = MI.getNumOperands(); OpIdx != End; ++OpIdx) {
224 const MachineOperand &MO = MI.getOperand(OpIdx);
227 unsigned Reg = MO.getReg();
230 // The register bank of Reg is just a side effect of the current
231 // excution and in particular, there is no reason to believe this
232 // is the best default mapping for the current instruction. Keep
233 // it as an alternative register bank if we cannot figure out
235 const RegisterBank *AltRegBank = getRegBank(Reg, MRI, TRI);
236 // For copy-like instruction, we want to reuse the register bank
237 // that is already set on Reg, if any, since those instructions do
238 // not have any constraints.
239 const RegisterBank *CurRegBank = isCopyLike ? AltRegBank : nullptr;
241 // If this is a target specific instruction, we can deduce
242 // the register bank from the encoding constraints.
243 CurRegBank = getRegBankFromConstraints(MI, OpIdx, TII, TRI);
245 // Check if we can deduce the register bank from the type of
247 Type *MITy = MI.getType();
249 CurRegBank = getRegBankForType(
250 MVT::getVT(MITy, /*HandleUnknown*/ true).SimpleTy);
252 // Use the current assigned register bank.
253 // That may not make much sense though.
254 CurRegBank = AltRegBank;
256 // All our attempts failed, give up.
257 CompleteMapping = false;
260 // MI does not carry enough information to guess the mapping.
261 return InstructionMapping();
263 // For copies, we want to keep interating to find a register
264 // bank for the other operands if we did not find one yet.
271 RegBank = CurRegBank;
272 RegSize = getSizeInBits(Reg, MRI, TRI);
273 Mapping.setOperandMapping(OpIdx, RegSize, *CurRegBank);
279 assert(isCopyLike && "We should have bailed on non-copies at this point");
280 // For copy like instruction, if none of the operand has a register
281 // bank avialable, there is nothing we can propagate.
283 return InstructionMapping();
285 // This is a copy-like instruction.
286 // Propagate RegBank to all operands that do not have a
288 for (unsigned OpIdx = 0, End = MI.getNumOperands(); OpIdx != End; ++OpIdx) {
289 const MachineOperand &MO = MI.getOperand(OpIdx);
290 // Don't assign a mapping for non-reg operands.
294 // If a mapping already exists, do not touch it.
295 if (!static_cast<const InstructionMapping *>(&Mapping)
296 ->getOperandMapping(OpIdx)
300 Mapping.setOperandMapping(OpIdx, RegSize, *RegBank);
305 RegisterBankInfo::InstructionMapping
306 RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
307 RegisterBankInfo::InstructionMapping Mapping = getInstrMappingImpl(MI);
308 if (Mapping.isValid())
310 llvm_unreachable("The target must implement this");
313 RegisterBankInfo::InstructionMappings
314 RegisterBankInfo::getInstrPossibleMappings(const MachineInstr &MI) const {
315 InstructionMappings PossibleMappings;
316 // Put the default mapping first.
317 PossibleMappings.push_back(getInstrMapping(MI));
318 // Then the alternative mapping, if any.
319 InstructionMappings AltMappings = getInstrAlternativeMappings(MI);
320 for (InstructionMapping &AltMapping : AltMappings)
321 PossibleMappings.emplace_back(std::move(AltMapping));
323 for (const InstructionMapping &Mapping : PossibleMappings)
324 assert(Mapping.verify(MI) && "Mapping is invalid");
326 return PossibleMappings;
329 RegisterBankInfo::InstructionMappings
330 RegisterBankInfo::getInstrAlternativeMappings(const MachineInstr &MI) const {
331 // No alternative for MI.
332 return InstructionMappings();
335 void RegisterBankInfo::applyDefaultMapping(const OperandsMapper &OpdMapper) {
336 MachineInstr &MI = OpdMapper.getMI();
337 DEBUG(dbgs() << "Applying default-like mapping\n");
338 for (unsigned OpIdx = 0, EndIdx = MI.getNumOperands(); OpIdx != EndIdx;
340 DEBUG(dbgs() << "OpIdx " << OpIdx);
341 MachineOperand &MO = MI.getOperand(OpIdx);
343 DEBUG(dbgs() << " is not a register, nothing to be done\n");
347 OpdMapper.getInstrMapping().getOperandMapping(OpIdx).BreakDown.size() ==
349 "This mapping is too complex for this function");
350 iterator_range<SmallVectorImpl<unsigned>::const_iterator> NewRegs =
351 OpdMapper.getVRegs(OpIdx);
352 if (NewRegs.begin() == NewRegs.end()) {
353 DEBUG(dbgs() << " has not been repaired, nothing to be done\n");
356 DEBUG(dbgs() << " changed, replace " << MO.getReg());
357 MO.setReg(*NewRegs.begin());
358 DEBUG(dbgs() << " with " << MO.getReg());
362 unsigned RegisterBankInfo::getSizeInBits(unsigned Reg,
363 const MachineRegisterInfo &MRI,
364 const TargetRegisterInfo &TRI) {
365 const TargetRegisterClass *RC = nullptr;
366 if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
367 // The size is not directly available for physical registers.
368 // Instead, we need to access a register class that contains Reg and
369 // get the size of that register class.
370 RC = TRI.getMinimalPhysRegClass(Reg);
372 unsigned RegSize = MRI.getSize(Reg);
373 // If Reg is not a generic register, query the register class to
377 // Since Reg is not a generic register, it must have a register class.
378 RC = MRI.getRegClass(Reg);
380 assert(RC && "Unable to deduce the register class");
381 return RC->getSize() * 8;
384 //------------------------------------------------------------------------------
385 // Helper classes implementation.
386 //------------------------------------------------------------------------------
387 void RegisterBankInfo::PartialMapping::dump() const {
392 bool RegisterBankInfo::PartialMapping::verify() const {
393 assert(RegBank && "Register bank not set");
394 assert(Length && "Empty mapping");
395 assert((StartIdx < getHighBitIdx()) && "Overflow, switch to APInt?");
396 // Check if the minimum width fits into RegBank.
397 assert(RegBank->getSize() >= Length && "Register bank too small for Mask");
401 void RegisterBankInfo::PartialMapping::print(raw_ostream &OS) const {
402 OS << "[" << StartIdx << ", " << getHighBitIdx() << "], RegBank = ";
409 bool RegisterBankInfo::ValueMapping::verify(unsigned ExpectedBitWidth) const {
410 assert(!BreakDown.empty() && "Value mapped nowhere?!");
411 unsigned OrigValueBitWidth = 0;
412 for (const RegisterBankInfo::PartialMapping &PartMap : BreakDown) {
413 // Check that each register bank is big enough to hold the partial value:
414 // this check is done by PartialMapping::verify
415 assert(PartMap.verify() && "Partial mapping is invalid");
416 // The original value should completely be mapped.
417 // Thus the maximum accessed index + 1 is the size of the original value.
419 std::max(OrigValueBitWidth, PartMap.getHighBitIdx() + 1);
421 assert(OrigValueBitWidth == ExpectedBitWidth && "BitWidth does not match");
422 APInt ValueMask(OrigValueBitWidth, 0);
423 for (const RegisterBankInfo::PartialMapping &PartMap : BreakDown) {
424 // Check that the union of the partial mappings covers the whole value,
426 // The high bit is exclusive in the APInt API, thus getHighBitIdx + 1.
427 APInt PartMapMask = APInt::getBitsSet(OrigValueBitWidth, PartMap.StartIdx,
428 PartMap.getHighBitIdx() + 1);
429 ValueMask ^= PartMapMask;
430 assert((ValueMask & PartMapMask) == PartMapMask &&
431 "Some partial mappings overlap");
433 assert(ValueMask.isAllOnesValue() && "Value is not fully mapped");
437 void RegisterBankInfo::ValueMapping::dump() const {
442 void RegisterBankInfo::ValueMapping::print(raw_ostream &OS) const {
443 OS << "#BreakDown: " << BreakDown.size() << " ";
445 for (const PartialMapping &PartMap : BreakDown) {
448 OS << '[' << PartMap << ']';
453 void RegisterBankInfo::InstructionMapping::setOperandMapping(
454 unsigned OpIdx, unsigned MaskSize, const RegisterBank &RegBank) {
455 // Build the value mapping.
456 assert(MaskSize <= RegBank.getSize() && "Register bank is too small");
458 // Create the mapping object.
459 getOperandMapping(OpIdx).BreakDown.push_back(
460 PartialMapping(0, MaskSize, RegBank));
463 bool RegisterBankInfo::InstructionMapping::verify(
464 const MachineInstr &MI) const {
465 // Check that all the register operands are properly mapped.
466 // Check the constructor invariant.
467 assert(NumOperands == MI.getNumOperands() &&
468 "NumOperands must match, see constructor");
469 assert(MI.getParent() && MI.getParent()->getParent() &&
470 "MI must be connected to a MachineFunction");
471 const MachineFunction &MF = *MI.getParent()->getParent();
474 for (unsigned Idx = 0; Idx < NumOperands; ++Idx) {
475 const MachineOperand &MO = MI.getOperand(Idx);
476 const RegisterBankInfo::ValueMapping &MOMapping = getOperandMapping(Idx);
479 assert(MOMapping.BreakDown.empty() &&
480 "We should not care about non-reg mapping");
483 unsigned Reg = MO.getReg();
486 // Register size in bits.
487 // This size must match what the mapping expects.
488 assert(MOMapping.verify(getSizeInBits(
489 Reg, MF.getRegInfo(), *MF.getSubtarget().getRegisterInfo())) &&
490 "Value mapping is invalid");
495 void RegisterBankInfo::InstructionMapping::dump() const {
500 void RegisterBankInfo::InstructionMapping::print(raw_ostream &OS) const {
501 OS << "ID: " << getID() << " Cost: " << getCost() << " Mapping: ";
503 for (unsigned OpIdx = 0; OpIdx != NumOperands; ++OpIdx) {
504 const ValueMapping &ValMapping = getOperandMapping(OpIdx);
507 OS << "{ Idx: " << OpIdx << " Map: " << ValMapping << '}';
511 const int RegisterBankInfo::OperandsMapper::DontKnowIdx = -1;
513 RegisterBankInfo::OperandsMapper::OperandsMapper(
514 MachineInstr &MI, const InstructionMapping &InstrMapping,
515 MachineRegisterInfo &MRI)
516 : MRI(MRI), MI(MI), InstrMapping(InstrMapping) {
517 unsigned NumOpds = MI.getNumOperands();
518 OpToNewVRegIdx.reset(new int[NumOpds]);
519 std::fill(&OpToNewVRegIdx[0], &OpToNewVRegIdx[NumOpds],
520 OperandsMapper::DontKnowIdx);
521 assert(InstrMapping.verify(MI) && "Invalid mapping for MI");
524 iterator_range<SmallVectorImpl<unsigned>::iterator>
525 RegisterBankInfo::OperandsMapper::getVRegsMem(unsigned OpIdx) {
526 assert(OpIdx < getMI().getNumOperands() && "Out-of-bound access");
527 unsigned NumPartialVal =
528 getInstrMapping().getOperandMapping(OpIdx).BreakDown.size();
529 int StartIdx = OpToNewVRegIdx[OpIdx];
531 if (StartIdx == OperandsMapper::DontKnowIdx) {
532 // This is the first time we try to access OpIdx.
533 // Create the cells that will hold all the partial values at the
534 // end of the list of NewVReg.
535 StartIdx = NewVRegs.size();
536 OpToNewVRegIdx[OpIdx] = StartIdx;
537 for (unsigned i = 0; i < NumPartialVal; ++i)
538 NewVRegs.push_back(0);
540 SmallVectorImpl<unsigned>::iterator End =
541 getNewVRegsEnd(StartIdx, NumPartialVal);
543 return make_range(&NewVRegs[StartIdx], End);
546 SmallVectorImpl<unsigned>::const_iterator
547 RegisterBankInfo::OperandsMapper::getNewVRegsEnd(unsigned StartIdx,
548 unsigned NumVal) const {
549 return const_cast<OperandsMapper *>(this)->getNewVRegsEnd(StartIdx, NumVal);
551 SmallVectorImpl<unsigned>::iterator
552 RegisterBankInfo::OperandsMapper::getNewVRegsEnd(unsigned StartIdx,
554 assert((NewVRegs.size() == StartIdx + NumVal ||
555 NewVRegs.size() > StartIdx + NumVal) &&
556 "NewVRegs too small to contain all the partial mapping");
557 return NewVRegs.size() <= StartIdx + NumVal ? NewVRegs.end()
558 : &NewVRegs[StartIdx + NumVal];
561 void RegisterBankInfo::OperandsMapper::createVRegs(unsigned OpIdx) {
562 assert(OpIdx < getMI().getNumOperands() && "Out-of-bound access");
563 iterator_range<SmallVectorImpl<unsigned>::iterator> NewVRegsForOpIdx =
565 const SmallVectorImpl<PartialMapping> &PartMapList =
566 getInstrMapping().getOperandMapping(OpIdx).BreakDown;
567 SmallVectorImpl<PartialMapping>::const_iterator PartMap = PartMapList.begin();
568 for (unsigned &NewVReg : NewVRegsForOpIdx) {
569 assert(PartMap != PartMapList.end() && "Out-of-bound access");
570 assert(NewVReg == 0 && "Register has already been created");
571 NewVReg = MRI.createGenericVirtualRegister(PartMap->Length);
572 MRI.setRegBank(NewVReg, *PartMap->RegBank);
577 void RegisterBankInfo::OperandsMapper::setVRegs(unsigned OpIdx,
578 unsigned PartialMapIdx,
580 assert(OpIdx < getMI().getNumOperands() && "Out-of-bound access");
581 assert(getInstrMapping().getOperandMapping(OpIdx).BreakDown.size() >
583 "Out-of-bound access for partial mapping");
584 // Make sure the memory is initialized for that operand.
585 (void)getVRegsMem(OpIdx);
586 assert(NewVRegs[OpToNewVRegIdx[OpIdx] + PartialMapIdx] == 0 &&
587 "This value is already set");
588 NewVRegs[OpToNewVRegIdx[OpIdx] + PartialMapIdx] = NewVReg;
591 iterator_range<SmallVectorImpl<unsigned>::const_iterator>
592 RegisterBankInfo::OperandsMapper::getVRegs(unsigned OpIdx,
593 bool ForDebug) const {
595 assert(OpIdx < getMI().getNumOperands() && "Out-of-bound access");
596 int StartIdx = OpToNewVRegIdx[OpIdx];
598 if (StartIdx == OperandsMapper::DontKnowIdx)
599 return make_range(NewVRegs.end(), NewVRegs.end());
601 unsigned PartMapSize =
602 getInstrMapping().getOperandMapping(OpIdx).BreakDown.size();
603 SmallVectorImpl<unsigned>::const_iterator End =
604 getNewVRegsEnd(StartIdx, PartMapSize);
605 iterator_range<SmallVectorImpl<unsigned>::const_iterator> Res =
606 make_range(&NewVRegs[StartIdx], End);
608 for (unsigned VReg : Res)
609 assert((VReg || ForDebug) && "Some registers are uninitialized");
614 void RegisterBankInfo::OperandsMapper::dump() const {
619 void RegisterBankInfo::OperandsMapper::print(raw_ostream &OS,
620 bool ForDebug) const {
621 unsigned NumOpds = getMI().getNumOperands();
623 OS << "Mapping for " << getMI() << "\nwith " << getInstrMapping() << '\n';
624 // Print out the internal state of the index table.
625 OS << "Populated indices (CellNumber, IndexInNewVRegs): ";
627 for (unsigned Idx = 0; Idx != NumOpds; ++Idx) {
628 if (OpToNewVRegIdx[Idx] != DontKnowIdx) {
631 OS << '(' << Idx << ", " << OpToNewVRegIdx[Idx] << ')';
637 OS << "Mapping ID: " << getInstrMapping().getID() << ' ';
639 OS << "Operand Mapping: ";
640 // If we have a function, we can pretty print the name of the registers.
641 // Otherwise we will print the raw numbers.
642 const TargetRegisterInfo *TRI =
643 getMI().getParent() && getMI().getParent()->getParent()
644 ? getMI().getParent()->getParent()->getSubtarget().getRegisterInfo()
647 for (unsigned Idx = 0; Idx != NumOpds; ++Idx) {
648 if (OpToNewVRegIdx[Idx] == DontKnowIdx)
653 OS << '(' << PrintReg(getMI().getOperand(Idx).getReg(), TRI) << ", [";
654 bool IsFirstNewVReg = true;
655 for (unsigned VReg : getVRegs(Idx)) {
658 IsFirstNewVReg = false;
659 OS << PrintReg(VReg, TRI);