@@ -895,7 +895,7 @@ bool SystemZVectorConstantInfo::isVectorConstantLegal(
895
895
if (SplatBitSize > 64 )
896
896
return false ;
897
897
898
- auto tryValue = [&](uint64_t Value) -> bool {
898
+ auto TryValue = [&](uint64_t Value) -> bool {
899
899
// Try VECTOR REPLICATE IMMEDIATE
900
900
int64_t SignedValue = SignExtend64 (Value, SplatBitSize);
901
901
if (isInt<16 >(SignedValue)) {
@@ -931,14 +931,14 @@ bool SystemZVectorConstantInfo::isVectorConstantLegal(
931
931
unsigned UpperBits = llvm::countl_zero (SplatBitsZ);
932
932
uint64_t Lower = SplatUndefZ & maskTrailingOnes<uint64_t >(LowerBits);
933
933
uint64_t Upper = SplatUndefZ & maskLeadingOnes<uint64_t >(UpperBits);
934
- if (tryValue (SplatBitsZ | Upper | Lower))
934
+ if (TryValue (SplatBitsZ | Upper | Lower))
935
935
return true ;
936
936
937
937
// Now try assuming that any undefined bits between the first and
938
938
// last defined set bits are set. This increases the chances of
939
939
// using a non-wraparound mask.
940
940
uint64_t Middle = SplatUndefZ & ~Upper & ~Lower;
941
- return tryValue (SplatBitsZ | Middle);
941
+ return TryValue (SplatBitsZ | Middle);
942
942
}
943
943
944
944
SystemZVectorConstantInfo::SystemZVectorConstantInfo (APInt IntImm) {
@@ -1007,8 +1007,8 @@ SystemZTargetLowering::emitEHSjLjSetJmp(MachineInstr &MI,
1007
1007
const TargetRegisterClass *RC = MRI.getRegClass (DstReg);
1008
1008
assert (TRI->isTypeLegalForClass (*RC, MVT::i32 ) && " Invalid destination!" );
1009
1009
(void )TRI;
1010
- Register mainDstReg = MRI.createVirtualRegister (RC);
1011
- Register restoreDstReg = MRI.createVirtualRegister (RC);
1010
+ Register MainDstReg = MRI.createVirtualRegister (RC);
1011
+ Register RestoreDstReg = MRI.createVirtualRegister (RC);
1012
1012
1013
1013
MVT PVT = getPointerTy (MF->getDataLayout ());
1014
1014
assert ((PVT == MVT::i64 || PVT == MVT::i32 ) && " Invalid Pointer Size!" );
@@ -1046,22 +1046,22 @@ SystemZTargetLowering::emitEHSjLjSetJmp(MachineInstr &MI,
1046
1046
// restoreMBB:
1047
1047
// v_restore = 1
1048
1048
1049
- MachineBasicBlock *thisMBB = MBB;
1050
- MachineBasicBlock *mainMBB = MF->CreateMachineBasicBlock (BB);
1051
- MachineBasicBlock *sinkMBB = MF->CreateMachineBasicBlock (BB);
1052
- MachineBasicBlock *restoreMBB = MF->CreateMachineBasicBlock (BB);
1049
+ MachineBasicBlock *ThisMBB = MBB;
1050
+ MachineBasicBlock *MainMBB = MF->CreateMachineBasicBlock (BB);
1051
+ MachineBasicBlock *SinkMBB = MF->CreateMachineBasicBlock (BB);
1052
+ MachineBasicBlock *RestoreMBB = MF->CreateMachineBasicBlock (BB);
1053
1053
1054
- MF->insert (I, mainMBB );
1055
- MF->insert (I, sinkMBB );
1056
- MF->push_back (restoreMBB );
1057
- restoreMBB ->setMachineBlockAddressTaken ();
1054
+ MF->insert (I, MainMBB );
1055
+ MF->insert (I, SinkMBB );
1056
+ MF->push_back (RestoreMBB );
1057
+ RestoreMBB ->setMachineBlockAddressTaken ();
1058
1058
1059
1059
MachineInstrBuilder MIB;
1060
1060
1061
1061
// Transfer the remainder of BB and its successor edges to sinkMBB.
1062
- sinkMBB ->splice (sinkMBB ->begin (), MBB,
1062
+ SinkMBB ->splice (SinkMBB ->begin (), MBB,
1063
1063
std::next (MachineBasicBlock::iterator (MI)), MBB->end ());
1064
- sinkMBB ->transferSuccessorsAndUpdatePHIs (MBB);
1064
+ SinkMBB ->transferSuccessorsAndUpdatePHIs (MBB);
1065
1065
1066
1066
// thisMBB:
1067
1067
const int64_t FPOffset = 0 ; // Slot 1.
@@ -1073,13 +1073,13 @@ SystemZTargetLowering::emitEHSjLjSetJmp(MachineInstr &MI,
1073
1073
Register BufReg = MI.getOperand (1 ).getReg ();
1074
1074
1075
1075
const TargetRegisterClass *PtrRC = getRegClassFor (PVT);
1076
- unsigned LabelReg = MRI.createVirtualRegister (PtrRC);
1076
+ Register LabelReg = MRI.createVirtualRegister (PtrRC);
1077
1077
1078
1078
// Prepare IP for longjmp.
1079
- BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::LARL), LabelReg)
1080
- .addMBB (restoreMBB );
1079
+ BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::LARL), LabelReg)
1080
+ .addMBB (RestoreMBB );
1081
1081
// Store IP for return from jmp, slot 2, offset = 1.
1082
- BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::STG))
1082
+ BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::STG))
1083
1083
.addReg (LabelReg)
1084
1084
.addReg (BufReg)
1085
1085
.addImm (LabelOffset)
@@ -1088,15 +1088,15 @@ SystemZTargetLowering::emitEHSjLjSetJmp(MachineInstr &MI,
1088
1088
auto *SpecialRegs = Subtarget.getSpecialRegisters ();
1089
1089
bool HasFP = Subtarget.getFrameLowering ()->hasFP (*MF);
1090
1090
if (HasFP) {
1091
- BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::STG))
1091
+ BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::STG))
1092
1092
.addReg (SpecialRegs->getFramePointerRegister ())
1093
1093
.addReg (BufReg)
1094
1094
.addImm (FPOffset)
1095
1095
.addReg (0 );
1096
1096
}
1097
1097
1098
1098
// Store SP.
1099
- BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::STG))
1099
+ BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::STG))
1100
1100
.addReg (SpecialRegs->getStackPointerRegister ())
1101
1101
.addReg (BufReg)
1102
1102
.addImm (SPOffset)
@@ -1107,47 +1107,47 @@ SystemZTargetLowering::emitEHSjLjSetJmp(MachineInstr &MI,
1107
1107
if (BackChain) {
1108
1108
Register BCReg = MRI.createVirtualRegister (PtrRC);
1109
1109
auto *TFL = Subtarget.getFrameLowering <SystemZFrameLowering>();
1110
- MIB = BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::LG), BCReg)
1110
+ MIB = BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::LG), BCReg)
1111
1111
.addReg (SpecialRegs->getStackPointerRegister ())
1112
1112
.addImm (TFL->getBackchainOffset (*MF))
1113
1113
.addReg (0 );
1114
1114
1115
- BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::STG))
1115
+ BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::STG))
1116
1116
.addReg (BCReg)
1117
1117
.addReg (BufReg)
1118
1118
.addImm (BCOffset)
1119
1119
.addReg (0 );
1120
1120
}
1121
1121
1122
1122
// Setup.
1123
- MIB = BuildMI (*thisMBB , MI, DL, TII->get (SystemZ::EH_SjLj_Setup))
1124
- .addMBB (restoreMBB );
1123
+ MIB = BuildMI (*ThisMBB , MI, DL, TII->get (SystemZ::EH_SjLj_Setup))
1124
+ .addMBB (RestoreMBB );
1125
1125
1126
1126
const SystemZRegisterInfo *RegInfo = Subtarget.getRegisterInfo ();
1127
1127
MIB.addRegMask (RegInfo->getNoPreservedMask ());
1128
1128
1129
- thisMBB ->addSuccessor (mainMBB );
1130
- thisMBB ->addSuccessor (restoreMBB );
1129
+ ThisMBB ->addSuccessor (MainMBB );
1130
+ ThisMBB ->addSuccessor (RestoreMBB );
1131
1131
1132
1132
// mainMBB:
1133
- BuildMI (mainMBB , DL, TII->get (SystemZ::LHI), mainDstReg ).addImm (0 );
1134
- mainMBB ->addSuccessor (sinkMBB );
1133
+ BuildMI (MainMBB , DL, TII->get (SystemZ::LHI), MainDstReg ).addImm (0 );
1134
+ MainMBB ->addSuccessor (SinkMBB );
1135
1135
1136
1136
// sinkMBB:
1137
- BuildMI (*sinkMBB, sinkMBB ->begin (), DL, TII->get (SystemZ::PHI), DstReg)
1138
- .addReg (mainDstReg )
1139
- .addMBB (mainMBB )
1140
- .addReg (restoreDstReg )
1141
- .addMBB (restoreMBB );
1137
+ BuildMI (*SinkMBB, SinkMBB ->begin (), DL, TII->get (SystemZ::PHI), DstReg)
1138
+ .addReg (MainDstReg )
1139
+ .addMBB (MainMBB )
1140
+ .addReg (RestoreDstReg )
1141
+ .addMBB (RestoreMBB );
1142
1142
1143
1143
// restoreMBB.
1144
- BuildMI (restoreMBB , DL, TII->get (SystemZ::LHI), restoreDstReg ).addImm (1 );
1145
- BuildMI (restoreMBB , DL, TII->get (SystemZ::J)).addMBB (sinkMBB );
1146
- restoreMBB ->addSuccessor (sinkMBB );
1144
+ BuildMI (RestoreMBB , DL, TII->get (SystemZ::LHI), RestoreDstReg ).addImm (1 );
1145
+ BuildMI (RestoreMBB , DL, TII->get (SystemZ::J)).addMBB (SinkMBB );
1146
+ RestoreMBB ->addSuccessor (SinkMBB );
1147
1147
1148
1148
MI.eraseFromParent ();
1149
1149
1150
- return sinkMBB ;
1150
+ return SinkMBB ;
1151
1151
}
1152
1152
1153
1153
MachineBasicBlock *
@@ -1510,71 +1510,72 @@ SystemZTargetLowering::getConstraintType(StringRef Constraint) const {
1510
1510
return TargetLowering::getConstraintType (Constraint);
1511
1511
}
1512
1512
1513
- TargetLowering::ConstraintWeight SystemZTargetLowering::
1514
- getSingleConstraintMatchWeight (AsmOperandInfo &info,
1515
- const char *constraint ) const {
1516
- ConstraintWeight weight = CW_Invalid;
1517
- Value *CallOperandVal = info .CallOperandVal ;
1513
+ TargetLowering::ConstraintWeight
1514
+ SystemZTargetLowering:: getSingleConstraintMatchWeight (
1515
+ AsmOperandInfo &Info, const char *Constraint ) const {
1516
+ ConstraintWeight Weight = CW_Invalid;
1517
+ Value *CallOperandVal = Info .CallOperandVal ;
1518
1518
// If we don't have a value, we can't do a match,
1519
1519
// but allow it at the lowest weight.
1520
1520
if (!CallOperandVal)
1521
1521
return CW_Default;
1522
1522
Type *type = CallOperandVal->getType ();
1523
1523
// Look at the constraint type.
1524
- switch (*constraint ) {
1524
+ switch (*Constraint ) {
1525
1525
default :
1526
- weight = TargetLowering::getSingleConstraintMatchWeight (info, constraint );
1526
+ Weight = TargetLowering::getSingleConstraintMatchWeight (Info, Constraint );
1527
1527
break ;
1528
1528
1529
1529
case ' a' : // Address register
1530
1530
case ' d' : // Data register (equivalent to 'r')
1531
1531
case ' h' : // High-part register
1532
1532
case ' r' : // General-purpose register
1533
- weight = CallOperandVal->getType ()->isIntegerTy () ? CW_Register : CW_Default;
1533
+ Weight =
1534
+ CallOperandVal->getType ()->isIntegerTy () ? CW_Register : CW_Default;
1534
1535
break ;
1535
1536
1536
1537
case ' f' : // Floating-point register
1537
1538
if (!useSoftFloat ())
1538
- weight = type->isFloatingPointTy () ? CW_Register : CW_Default;
1539
+ Weight = type->isFloatingPointTy () ? CW_Register : CW_Default;
1539
1540
break ;
1540
1541
1541
1542
case ' v' : // Vector register
1542
1543
if (Subtarget.hasVector ())
1543
- weight = (type->isVectorTy () || type->isFloatingPointTy ()) ? CW_Register
1544
+ Weight = (type->isVectorTy () || type->isFloatingPointTy ()) ? CW_Register
1544
1545
: CW_Default;
1545
1546
break ;
1546
1547
1547
1548
case ' I' : // Unsigned 8-bit constant
1548
1549
if (auto *C = dyn_cast<ConstantInt>(CallOperandVal))
1549
1550
if (isUInt<8 >(C->getZExtValue ()))
1550
- weight = CW_Constant;
1551
+ Weight = CW_Constant;
1551
1552
break ;
1552
1553
1553
1554
case ' J' : // Unsigned 12-bit constant
1554
1555
if (auto *C = dyn_cast<ConstantInt>(CallOperandVal))
1555
1556
if (isUInt<12 >(C->getZExtValue ()))
1556
- weight = CW_Constant;
1557
+ Weight = CW_Constant;
1557
1558
break ;
1558
1559
1559
1560
case ' K' : // Signed 16-bit constant
1560
1561
if (auto *C = dyn_cast<ConstantInt>(CallOperandVal))
1561
1562
if (isInt<16 >(C->getSExtValue ()))
1562
- weight = CW_Constant;
1563
+ Weight = CW_Constant;
1563
1564
break ;
1564
1565
1565
1566
case ' L' : // Signed 20-bit displacement (on all targets we support)
1566
1567
if (auto *C = dyn_cast<ConstantInt>(CallOperandVal))
1567
1568
if (isInt<20 >(C->getSExtValue ()))
1568
- weight = CW_Constant;
1569
+ Weight = CW_Constant;
1569
1570
break ;
1570
1571
1571
1572
case ' M' : // 0x7fffffff
1572
1573
if (auto *C = dyn_cast<ConstantInt>(CallOperandVal))
1573
1574
if (C->getZExtValue () == 0x7fffffff )
1574
- weight = CW_Constant;
1575
+ Weight = CW_Constant;
1575
1576
break ;
1576
1577
}
1577
- return weight ;
1578
+ return Weight ;
1578
1579
}
1579
1580
1580
1581
// Parse a "{tNNN}" register constraint for which the register type "t"
@@ -2137,7 +2138,7 @@ static SDValue getADAEntry(SelectionDAG &DAG, SDValue Val, SDLoc DL,
2137
2138
unsigned Offset, bool LoadAdr = false ) {
2138
2139
MachineFunction &MF = DAG.getMachineFunction ();
2139
2140
SystemZMachineFunctionInfo *MFI = MF.getInfo <SystemZMachineFunctionInfo>();
2140
- unsigned ADAvReg = MFI->getADAVirtualRegister ();
2141
+ Register ADAvReg = MFI->getADAVirtualRegister ();
2141
2142
EVT PtrVT = DAG.getTargetLoweringInfo ().getPointerTy (DAG.getDataLayout ());
2142
2143
2143
2144
SDValue Reg = DAG.getRegister (ADAvReg, PtrVT);
@@ -2191,7 +2192,7 @@ static bool getzOSCalleeAndADA(SelectionDAG &DAG, SDValue &Callee, SDValue &ADA,
2191
2192
if (IsInternal) {
2192
2193
SystemZMachineFunctionInfo *MFI =
2193
2194
MF.getInfo <SystemZMachineFunctionInfo>();
2194
- unsigned ADAvReg = MFI->getADAVirtualRegister ();
2195
+ Register ADAvReg = MFI->getADAVirtualRegister ();
2195
2196
ADA = DAG.getCopyFromReg (Chain, DL, ADAvReg, PtrVT);
2196
2197
Callee = DAG.getTargetGlobalAddress (G->getGlobal (), DL, PtrVT);
2197
2198
Callee = DAG.getNode (SystemZISD::PCREL_WRAPPER, DL, PtrVT, Callee);
@@ -2482,20 +2483,18 @@ std::pair<SDValue, SDValue> SystemZTargetLowering::makeExternalCall(
2482
2483
return LowerCallTo (CLI);
2483
2484
}
2484
2485
2485
- bool SystemZTargetLowering::
2486
- CanLowerReturn (CallingConv::ID CallConv,
2487
- MachineFunction &MF, bool isVarArg,
2488
- const SmallVectorImpl<ISD::OutputArg> &Outs,
2489
- LLVMContext &Context,
2490
- const Type *RetTy) const {
2486
+ bool SystemZTargetLowering::CanLowerReturn (
2487
+ CallingConv::ID CallConv, MachineFunction &MF, bool IsVarArg,
2488
+ const SmallVectorImpl<ISD::OutputArg> &Outs, LLVMContext &Context,
2489
+ const Type *RetTy) const {
2491
2490
// Special case that we cannot easily detect in RetCC_SystemZ since
2492
2491
// i128 may not be a legal type.
2493
2492
for (auto &Out : Outs)
2494
2493
if (Out.ArgVT == MVT::i128 )
2495
2494
return false ;
2496
2495
2497
2496
SmallVector<CCValAssign, 16 > RetLocs;
2498
- CCState RetCCInfo (CallConv, isVarArg , MF, RetLocs, Context);
2497
+ CCState RetCCInfo (CallConv, IsVarArg , MF, RetLocs, Context);
2499
2498
return RetCCInfo.CheckReturn (Outs, RetCC_SystemZ);
2500
2499
}
2501
2500
@@ -6051,8 +6050,8 @@ SDValue GeneralShuffle::getNode(SelectionDAG &DAG, const SDLoc &DL) {
6051
6050
#ifndef NDEBUG
6052
6051
static void dumpBytes (const SmallVectorImpl<int > &Bytes, std::string Msg) {
6053
6052
dbgs () << Msg.c_str () << " { " ;
6054
- for (unsigned i = 0 ; i < Bytes.size (); i ++)
6055
- dbgs () << Bytes[i ] << " " ;
6053
+ for (unsigned I = 0 ; I < Bytes.size (); I ++)
6054
+ dbgs () << Bytes[I ] << " " ;
6056
6055
dbgs () << " }\n " ;
6057
6056
}
6058
6057
#endif
@@ -6767,7 +6766,7 @@ SDValue SystemZTargetLowering::lowerFSHR(SDValue Op, SelectionDAG &DAG) const {
6767
6766
}
6768
6767
6769
6768
static SDValue lowerAddrSpaceCast (SDValue Op, SelectionDAG &DAG) {
6770
- SDLoc dl (Op);
6769
+ SDLoc DL (Op);
6771
6770
SDValue Src = Op.getOperand (0 );
6772
6771
MVT DstVT = Op.getSimpleValueType ();
6773
6772
@@ -6780,14 +6779,14 @@ static SDValue lowerAddrSpaceCast(SDValue Op, SelectionDAG &DAG) {
6780
6779
// addrspacecast [0 <- 1] : Assinging a ptr32 value to a 64-bit pointer.
6781
6780
// addrspacecast [1 <- 0] : Assigining a 64-bit pointer to a ptr32 value.
6782
6781
if (SrcAS == SYSTEMZAS::PTR32 && DstVT == MVT::i64 ) {
6783
- Op = DAG.getNode (ISD::AND, dl , MVT::i32 , Src,
6784
- DAG.getConstant (0x7fffffff , dl , MVT::i32 ));
6785
- Op = DAG.getNode (ISD::ZERO_EXTEND, dl , DstVT, Op);
6782
+ Op = DAG.getNode (ISD::AND, DL , MVT::i32 , Src,
6783
+ DAG.getConstant (0x7fffffff , DL , MVT::i32 ));
6784
+ Op = DAG.getNode (ISD::ZERO_EXTEND, DL , DstVT, Op);
6786
6785
} else if (DstVT == MVT::i32 ) {
6787
- Op = DAG.getNode (ISD::TRUNCATE, dl , DstVT, Src);
6788
- Op = DAG.getNode (ISD::AND, dl , MVT::i32 , Op,
6789
- DAG.getConstant (0x7fffffff , dl , MVT::i32 ));
6790
- Op = DAG.getNode (ISD::ZERO_EXTEND, dl , DstVT, Op);
6786
+ Op = DAG.getNode (ISD::TRUNCATE, DL , DstVT, Src);
6787
+ Op = DAG.getNode (ISD::AND, DL , MVT::i32 , Op,
6788
+ DAG.getConstant (0x7fffffff , DL , MVT::i32 ));
6789
+ Op = DAG.getNode (ISD::ZERO_EXTEND, DL , DstVT, Op);
6791
6790
} else {
6792
6791
report_fatal_error (" Bad address space in addrspacecast" );
6793
6792
}
@@ -9285,8 +9284,8 @@ SystemZTargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
9285
9284
Known.resetAll ();
9286
9285
9287
9286
// Intrinsic CC result is returned in the two low bits.
9288
- unsigned tmp0, tmp1 ; // not used
9289
- if (Op.getResNo () == 1 && isIntrinsicWithCC (Op, tmp0, tmp1 )) {
9287
+ unsigned Tmp0, Tmp1 ; // not used
9288
+ if (Op.getResNo () == 1 && isIntrinsicWithCC (Op, Tmp0, Tmp1 )) {
9290
9289
Known.Zero .setBitsFrom (2 );
9291
9290
return ;
9292
9291
}
@@ -9511,10 +9510,10 @@ static bool checkCCKill(MachineInstr &MI, MachineBasicBlock *MBB) {
9511
9510
// Scan forward through BB for a use/def of CC.
9512
9511
MachineBasicBlock::iterator miI (std::next (MachineBasicBlock::iterator (MI)));
9513
9512
for (MachineBasicBlock::iterator miE = MBB->end (); miI != miE; ++miI) {
9514
- const MachineInstr& mi = *miI;
9515
- if (mi .readsRegister (SystemZ::CC, /* TRI=*/ nullptr ))
9513
+ const MachineInstr &MI = *miI;
9514
+ if (MI .readsRegister (SystemZ::CC, /* TRI=*/ nullptr ))
9516
9515
return false ;
9517
- if (mi .definesRegister (SystemZ::CC, /* TRI=*/ nullptr ))
9516
+ if (MI .definesRegister (SystemZ::CC, /* TRI=*/ nullptr ))
9518
9517
break ; // Should have kill-flag - update below.
9519
9518
}
9520
9519
0 commit comments