@@ -82,7 +82,8 @@ static unsigned countOperands(SDNode *Node, unsigned NumExpUses,
82
82
// / EmitCopyFromReg - Generate machine code for an CopyFromReg node or an
83
83
// / implicit physical register output.
84
84
void InstrEmitter::EmitCopyFromReg (SDNode *Node, unsigned ResNo, bool IsClone,
85
- Register SrcReg, VRBaseMapType &VRBaseMap) {
85
+ Register SrcReg,
86
+ DenseMap<SDValue, Register> &VRBaseMap) {
86
87
Register VRBase;
87
88
if (SrcReg.isVirtual ()) {
88
89
// Just use the input register directly!
@@ -186,7 +187,7 @@ void InstrEmitter::CreateVirtualRegisters(SDNode *Node,
186
187
MachineInstrBuilder &MIB,
187
188
const MCInstrDesc &II,
188
189
bool IsClone, bool IsCloned,
189
- VRBaseMapType &VRBaseMap) {
190
+ DenseMap<SDValue, Register> &VRBaseMap) {
190
191
assert (Node->getMachineOpcode () != TargetOpcode::IMPLICIT_DEF &&
191
192
" IMPLICIT_DEF should have been handled as a special case elsewhere!" );
192
193
@@ -264,7 +265,8 @@ void InstrEmitter::CreateVirtualRegisters(SDNode *Node,
264
265
265
266
// / getVR - Return the virtual register corresponding to the specified result
266
267
// / of the specified node.
267
- Register InstrEmitter::getVR (SDValue Op, VRBaseMapType &VRBaseMap) {
268
+ Register InstrEmitter::getVR (SDValue Op,
269
+ DenseMap<SDValue, Register> &VRBaseMap) {
268
270
if (Op.isMachineOpcode () &&
269
271
Op.getMachineOpcode () == TargetOpcode::IMPLICIT_DEF) {
270
272
// Add an IMPLICIT_DEF instruction before every use.
@@ -278,7 +280,7 @@ Register InstrEmitter::getVR(SDValue Op, VRBaseMapType &VRBaseMap) {
278
280
return VReg;
279
281
}
280
282
281
- VRBaseMapType ::iterator I = VRBaseMap.find (Op);
283
+ DenseMap<SDValue, Register> ::iterator I = VRBaseMap.find (Op);
282
284
assert (I != VRBaseMap.end () && " Node emitted out of order - late" );
283
285
return I->second ;
284
286
}
@@ -316,7 +318,7 @@ InstrEmitter::AddRegisterOperand(MachineInstrBuilder &MIB,
316
318
SDValue Op,
317
319
unsigned IIOpNum,
318
320
const MCInstrDesc *II,
319
- VRBaseMapType &VRBaseMap,
321
+ DenseMap<SDValue, Register> &VRBaseMap,
320
322
bool IsDebug, bool IsClone, bool IsCloned) {
321
323
assert (Op.getValueType () != MVT::Other &&
322
324
Op.getValueType () != MVT::Glue &&
@@ -393,10 +395,12 @@ InstrEmitter::AddRegisterOperand(MachineInstrBuilder &MIB,
393
395
// / AddOperand - Add the specified operand to the specified machine instr. II
394
396
// / specifies the instruction information for the node, and IIOpNum is the
395
397
// / operand number (in the II) that we are adding.
396
- void InstrEmitter::AddOperand (MachineInstrBuilder &MIB, SDValue Op,
397
- unsigned IIOpNum, const MCInstrDesc *II,
398
- VRBaseMapType &VRBaseMap, bool IsDebug,
399
- bool IsClone, bool IsCloned) {
398
+ void InstrEmitter::AddOperand (MachineInstrBuilder &MIB,
399
+ SDValue Op,
400
+ unsigned IIOpNum,
401
+ const MCInstrDesc *II,
402
+ DenseMap<SDValue, Register> &VRBaseMap,
403
+ bool IsDebug, bool IsClone, bool IsCloned) {
400
404
if (Op.isMachineOpcode ()) {
401
405
AddRegisterOperand (MIB, Op, IIOpNum, II, VRBaseMap,
402
406
IsDebug, IsClone, IsCloned);
@@ -495,7 +499,8 @@ Register InstrEmitter::ConstrainForSubReg(Register VReg, unsigned SubIdx,
495
499
496
500
// / EmitSubregNode - Generate machine code for subreg nodes.
497
501
// /
498
- void InstrEmitter::EmitSubregNode (SDNode *Node, VRBaseMapType &VRBaseMap,
502
+ void InstrEmitter::EmitSubregNode (SDNode *Node,
503
+ DenseMap<SDValue, Register> &VRBaseMap,
499
504
bool IsClone, bool IsCloned) {
500
505
Register VRBase;
501
506
unsigned Opc = Node->getMachineOpcode ();
@@ -629,7 +634,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node, VRBaseMapType &VRBaseMap,
629
634
// /
630
635
void
631
636
InstrEmitter::EmitCopyToRegClassNode (SDNode *Node,
632
- VRBaseMapType &VRBaseMap) {
637
+ DenseMap<SDValue, Register> &VRBaseMap) {
633
638
Register VReg = getVR (Node->getOperand (0 ), VRBaseMap);
634
639
635
640
// Create the new VReg in the destination class and emit a copy.
@@ -648,8 +653,9 @@ InstrEmitter::EmitCopyToRegClassNode(SDNode *Node,
648
653
649
654
// / EmitRegSequence - Generate machine code for REG_SEQUENCE nodes.
650
655
// /
651
- void InstrEmitter::EmitRegSequence (SDNode *Node, VRBaseMapType &VRBaseMap,
652
- bool IsClone, bool IsCloned) {
656
+ void InstrEmitter::EmitRegSequence (SDNode *Node,
657
+ DenseMap<SDValue, Register> &VRBaseMap,
658
+ bool IsClone, bool IsCloned) {
653
659
unsigned DstRCIdx = Node->getConstantOperandVal (0 );
654
660
const TargetRegisterClass *RC = TRI->getRegClass (DstRCIdx);
655
661
Register NewVReg = MRI->createVirtualRegister (TRI->getAllocatableClass (RC));
@@ -697,7 +703,7 @@ void InstrEmitter::EmitRegSequence(SDNode *Node, VRBaseMapType &VRBaseMap,
697
703
// /
698
704
MachineInstr *
699
705
InstrEmitter::EmitDbgValue (SDDbgValue *SD,
700
- VRBaseMapType &VRBaseMap) {
706
+ DenseMap<SDValue, Register> &VRBaseMap) {
701
707
DebugLoc DL = SD->getDebugLoc ();
702
708
assert (cast<DILocalVariable>(SD->getVariable ())
703
709
->isValidLocationForIntrinsic (DL) &&
@@ -749,7 +755,7 @@ MachineOperand GetMOForConstDbgOp(const SDDbgOperand &Op) {
749
755
void InstrEmitter::AddDbgValueLocationOps (
750
756
MachineInstrBuilder &MIB, const MCInstrDesc &DbgValDesc,
751
757
ArrayRef<SDDbgOperand> LocationOps,
752
- VRBaseMapType &VRBaseMap) {
758
+ DenseMap<SDValue, Register> &VRBaseMap) {
753
759
for (const SDDbgOperand &Op : LocationOps) {
754
760
switch (Op.getKind ()) {
755
761
case SDDbgOperand::FRAMEIX:
@@ -780,7 +786,7 @@ void InstrEmitter::AddDbgValueLocationOps(
780
786
781
787
MachineInstr *
782
788
InstrEmitter::EmitDbgInstrRef (SDDbgValue *SD,
783
- VRBaseMapType &VRBaseMap) {
789
+ DenseMap<SDValue, Register> &VRBaseMap) {
784
790
MDNode *Var = SD->getVariable ();
785
791
const DIExpression *Expr = (DIExpression *)SD->getExpression ();
786
792
DebugLoc DL = SD->getDebugLoc ();
@@ -856,7 +862,7 @@ InstrEmitter::EmitDbgInstrRef(SDDbgValue *SD,
856
862
// Look up the corresponding VReg for the given SDNode, if any.
857
863
SDNode *Node = DbgOperand.getSDNode ();
858
864
SDValue Op = SDValue (Node, DbgOperand.getResNo ());
859
- VRBaseMapType ::iterator I = VRBaseMap.find (Op);
865
+ DenseMap<SDValue, Register> ::iterator I = VRBaseMap.find (Op);
860
866
// No VReg -> produce a DBG_VALUE $noreg instead.
861
867
if (I == VRBaseMap.end ())
862
868
break ;
@@ -922,7 +928,7 @@ MachineInstr *InstrEmitter::EmitDbgNoLocation(SDDbgValue *SD) {
922
928
923
929
MachineInstr *
924
930
InstrEmitter::EmitDbgValueList (SDDbgValue *SD,
925
- VRBaseMapType &VRBaseMap) {
931
+ DenseMap<SDValue, Register> &VRBaseMap) {
926
932
MDNode *Var = SD->getVariable ();
927
933
DIExpression *Expr = SD->getExpression ();
928
934
DebugLoc DL = SD->getDebugLoc ();
@@ -938,7 +944,7 @@ InstrEmitter::EmitDbgValueList(SDDbgValue *SD,
938
944
939
945
MachineInstr *
940
946
InstrEmitter::EmitDbgValueFromSingleOp (SDDbgValue *SD,
941
- VRBaseMapType &VRBaseMap) {
947
+ DenseMap<SDValue, Register> &VRBaseMap) {
942
948
MDNode *Var = SD->getVariable ();
943
949
DIExpression *Expr = SD->getExpression ();
944
950
DebugLoc DL = SD->getDebugLoc ();
@@ -990,7 +996,7 @@ InstrEmitter::EmitDbgLabel(SDDbgLabel *SD) {
990
996
// /
991
997
void InstrEmitter::
992
998
EmitMachineNode (SDNode *Node, bool IsClone, bool IsCloned,
993
- VRBaseMapType &VRBaseMap) {
999
+ DenseMap<SDValue, Register> &VRBaseMap) {
994
1000
unsigned Opc = Node->getMachineOpcode ();
995
1001
996
1002
// Handle subreg insert/extract specially
@@ -1232,7 +1238,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
1232
1238
// / needed dependencies.
1233
1239
void InstrEmitter::
1234
1240
EmitSpecialNode (SDNode *Node, bool IsClone, bool IsCloned,
1235
- VRBaseMapType &VRBaseMap) {
1241
+ DenseMap<SDValue, Register> &VRBaseMap) {
1236
1242
switch (Node->getOpcode ()) {
1237
1243
default :
1238
1244
#ifndef NDEBUG
0 commit comments