Skip to content

Commit 0ac5ef2

Browse files
committed
fix some comment grammar
1 parent 29ed251 commit 0ac5ef2

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5239,10 +5239,6 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
52395239
MachineRegisterInfo *MRI,
52405240
unsigned BinOpDepth,
52415241
LiveVariables *LV) const {
5242-
const TargetRegisterClass *RC = MRI->getRegClass(Reg);
5243-
if (RC == &PPC::G8RCRegClass || RC == &PPC::GPRC_and_GPRC_NOR0RegClass)
5244-
return;
5245-
52465242
MachineInstr *MI = MRI->getVRegDef(Reg);
52475243
if (!MI)
52485244
return;
@@ -5255,9 +5251,6 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
52555251
case PPC::PHI:
52565252
case PPC::ISEL:
52575253
if (BinOpDepth < MAX_BINOP_DEPTH) {
5258-
if (Opcode == PPC::OR || Opcode == PPC::ISEL)
5259-
// if (Opcode == PPC::OR)
5260-
IsRelplaceIntr = true;
52615254
unsigned OperandEnd = 3, OperandStride = 1;
52625255
if (Opcode == PPC::PHI) {
52635256
OperandEnd = MI->getNumOperands();
@@ -5269,24 +5262,30 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
52695262
Register SrcReg = MI->getOperand(I).getReg();
52705263
replaceInstrAfterElimExt32To64(SrcReg, MRI, BinOpDepth + 1, LV);
52715264
}
5265+
5266+
if (Opcode == PPC::OR || Opcode == PPC::ISEL)
5267+
IsRelplaceIntr = true;
5268+
else
5269+
return;
52725270
}
52735271
break;
52745272
case PPC::COPY: {
52755273
Register SrcReg = MI->getOperand(1).getReg();
52765274
const MachineFunction *MF = MI->getMF();
52775275
if (!MF->getSubtarget<PPCSubtarget>().isSVR4ABI()) {
52785276
replaceInstrAfterElimExt32To64(SrcReg, MRI, BinOpDepth, LV);
5279-
break;
5277+
return;
52805278
}
52815279
// From here on everything is SVR4ABI
52825280
if (MI->getParent()->getBasicBlock() == &MF->getFunction().getEntryBlock())
5283-
break;
5281+
return;
52845282

52855283
if (SrcReg != PPC::X3) {
52865284
replaceInstrAfterElimExt32To64(SrcReg, MRI, BinOpDepth, LV);
5287-
break;
5285+
return;
52885286
}
5289-
} break;
5287+
}
5288+
return;
52905289
case PPC::ORI:
52915290
case PPC::XORI:
52925291
case PPC::ORI8:
@@ -5295,22 +5294,27 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
52955294
case PPC::XORIS:
52965295
case PPC::ORIS8:
52975296
case PPC::XORIS8: {
5297+
Register SrcReg = MI->getOperand(1).getReg();
5298+
replaceInstrAfterElimExt32To64(SrcReg, MRI, BinOpDepth, LV);
5299+
52985300
if (Opcode == PPC::ORI || Opcode == PPC::XORI || Opcode == PPC::ORIS ||
52995301
Opcode == PPC::ORIS || Opcode == PPC::XORIS)
53005302
IsRelplaceIntr = true;
5301-
Register SrcReg = MI->getOperand(1).getReg();
5302-
replaceInstrAfterElimExt32To64(SrcReg, MRI, BinOpDepth, LV);
5303+
else
5304+
return;
53035305
break;
53045306
}
53055307
case PPC::AND:
53065308
case PPC::AND8: {
53075309
if (BinOpDepth < MAX_BINOP_DEPTH) {
5308-
if (Opcode == PPC::AND)
5309-
IsRelplaceIntr = true;
53105310
Register SrcReg1 = MI->getOperand(1).getReg();
53115311
replaceInstrAfterElimExt32To64(SrcReg1, MRI, BinOpDepth, LV);
53125312
Register SrcReg2 = MI->getOperand(2).getReg();
53135313
replaceInstrAfterElimExt32To64(SrcReg2, MRI, BinOpDepth, LV);
5314+
if (Opcode == PPC::AND)
5315+
IsRelplaceIntr = true;
5316+
else
5317+
return;
53145318
}
53155319
break;
53165320
}
@@ -5324,9 +5328,14 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
53245328
!isOpZeroOfSubwordPreincLoad(Opcode)) ||
53255329
IsRelplaceIntr) {
53265330

5327-
// Fix Me: Most of the opcode of 64-bit instruction equal to the opcode of
5328-
// 32-bit version of same instruction plus one. But there are some
5329-
// exception: PPC::ANDC_rec, PPC::ANDI_rec, PPC::ANDIS_rec.
5331+
const TargetRegisterClass *RC = MRI->getRegClass(Reg);
5332+
assert(RC != &PPC::G8RCRegClass && RC != &PPC::G8RC_and_G8RC_NOX0RegClass &&
5333+
"Must be 32-bit Register!");
5334+
5335+
// Fix Me: Most of the pseudo-opcode of 64-bit instruction are equal to
5336+
// the pseudo-opcode of the 32-bit version of the same instruction plus
5337+
// one. However, there are some exceptions: PPC::ANDC_rec,
5338+
// PPC::ANDI_rec, PPC::ANDIS_rec.
53305339
unsigned NewOpcode = Opcode + 1;
53315340

53325341
if (Opcode == PPC::ANDC_rec)
@@ -5350,8 +5359,11 @@ void PPCInstrInfo::replaceInstrAfterElimExt32To64(const Register &Reg,
53505359
DebugLoc DL = MI->getDebugLoc();
53515360
auto MBB = MI->getParent();
53525361

5353-
// If the oprand of the instruction is Register which isPPC::GRCRegClass, we
5354-
// need to promot the Oprande to PPC::G8RCRegClass.
5362+
// Since the pseudo-opcode of the instruction is promoted from 32-bit to
5363+
// 64-bit, if the operand of the original instruction belongs to
5364+
// PPC::GRCRegClass or PPC::GPRC_and_GPRC_NOR0RegClass, we need to promote
5365+
// the operand to PPC::G8CRegClass or PPC::G8RC_and_G8RC_NOR0RegClass,
5366+
// respectively.
53555367
DenseMap<unsigned, Register> PromoteRegs;
53565368
DenseMap<unsigned, Register> ReCalRegs;
53575369
for (unsigned i = 1; i < MI->getNumOperands(); i++) {

0 commit comments

Comments
 (0)