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