Commit 81b2d1d1 authored by Jinsong Ji's avatar Jinsong Ji
Browse files

[NFC][PowerPC] Fix some typos in MachineCombiner comments

parent 3d123e17
...@@ -289,12 +289,11 @@ bool PPCInstrInfo::isAssociativeAndCommutative(const MachineInstr &Inst) const { ...@@ -289,12 +289,11 @@ bool PPCInstrInfo::isAssociativeAndCommutative(const MachineInstr &Inst) const {
// Index 0(InfoArrayIdxFMAInst): FMA instruction; // Index 0(InfoArrayIdxFMAInst): FMA instruction;
// Index 1(InfoArrayIdxFAddInst): ADD instruction assoaicted with FMA; // Index 1(InfoArrayIdxFAddInst): ADD instruction assoaicted with FMA;
// Index 2(InfoArrayIdxFMULInst): MUL instruction assoaicted with FMA; // Index 2(InfoArrayIdxFMULInst): MUL instruction assoaicted with FMA;
// Index 3(InfoArrayIdxAddOpIdx): ADD operand index in the FMA operand list; // Index 3(InfoArrayIdxAddOpIdx): ADD operand index in FMA operands;
// Index 4(InfoArrayIdxMULOpIdx): first MUL operand index in the FMA operand // Index 4(InfoArrayIdxMULOpIdx): first MUL operand index in FMA operands;
// list;
// second MUL operand index is plus 1. // second MUL operand index is plus 1.
static const uint16_t FMAOpIdxInfo[][5] = { static const uint16_t FMAOpIdxInfo[][5] = {
// FIXME: add more FMA instructions like XSNMADDADP and so on. // FIXME: Add more FMA instructions like XSNMADDADP and so on.
{PPC::XSMADDADP, PPC::XSADDDP, PPC::XSMULDP, 1, 2}, {PPC::XSMADDADP, PPC::XSADDDP, PPC::XSMULDP, 1, 2},
{PPC::XSMADDASP, PPC::XSADDSP, PPC::XSMULSP, 1, 2}, {PPC::XSMADDASP, PPC::XSADDSP, PPC::XSMULSP, 1, 2},
{PPC::XVMADDADP, PPC::XVADDDP, PPC::XVMULDP, 1, 2}, {PPC::XVMADDADP, PPC::XVADDDP, PPC::XVMULDP, 1, 2},
...@@ -362,12 +361,12 @@ bool PPCInstrInfo::getFMAPatterns( ...@@ -362,12 +361,12 @@ bool PPCInstrInfo::getFMAPatterns(
return false; return false;
// Instruction can be reassociated. // Instruction can be reassociated.
// fast match flags may prohibit reassociation. // fast math flags may prohibit reassociation.
if (!(Instr.getFlag(MachineInstr::MIFlag::FmReassoc) && if (!(Instr.getFlag(MachineInstr::MIFlag::FmReassoc) &&
Instr.getFlag(MachineInstr::MIFlag::FmNsz))) Instr.getFlag(MachineInstr::MIFlag::FmNsz)))
return false; return false;
// Instruction operands are virtual registers for reassociating. // Instruction operands are virtual registers for reassociation.
if (!IsAllOpsVirtualReg(Instr)) if (!IsAllOpsVirtualReg(Instr))
return false; return false;
...@@ -544,7 +543,7 @@ void PPCInstrInfo::reassociateFMA( ...@@ -544,7 +543,7 @@ void PPCInstrInfo::reassociateFMA(
.addReg(RegY, getKillRegState(KillY)) .addReg(RegY, getKillRegState(KillY))
.addReg(RegM31, getKillRegState(KillM31)) .addReg(RegM31, getKillRegState(KillM31))
.addReg(RegM32, getKillRegState(KillM32)); .addReg(RegM32, getKillRegState(KillM32));
// if AddOpIdx is not 1, adjust the order. // If AddOpIdx is not 1, adjust the order.
if (AddOpIdx != 1) { if (AddOpIdx != 1) {
AdjustOperandOrder(MINewB, RegX, KillX, RegM21, KillM21, RegM22, KillM22); AdjustOperandOrder(MINewB, RegX, KillX, RegM21, KillM21, RegM22, KillM22);
AdjustOperandOrder(MINewA, RegY, KillY, RegM31, KillM31, RegM32, KillM32); AdjustOperandOrder(MINewA, RegY, KillY, RegM31, KillM31, RegM32, KillM32);
...@@ -556,7 +555,7 @@ void PPCInstrInfo::reassociateFMA( ...@@ -556,7 +555,7 @@ void PPCInstrInfo::reassociateFMA(
.addReg(NewVRB, getKillRegState(true)) .addReg(NewVRB, getKillRegState(true))
.addReg(NewVRA, getKillRegState(true)); .addReg(NewVRA, getKillRegState(true));
// update flags for new created instructions. // Update flags for newly created instructions.
setSpecialOperandAttr(*MINewA, IntersectedFlags); setSpecialOperandAttr(*MINewA, IntersectedFlags);
setSpecialOperandAttr(*MINewB, IntersectedFlags); setSpecialOperandAttr(*MINewB, IntersectedFlags);
setSpecialOperandAttr(*MINewC, IntersectedFlags); setSpecialOperandAttr(*MINewC, IntersectedFlags);
...@@ -596,7 +595,7 @@ void PPCInstrInfo::reassociateFMA( ...@@ -596,7 +595,7 @@ void PPCInstrInfo::reassociateFMA(
.addReg(NewVRB, getKillRegState(true)) .addReg(NewVRB, getKillRegState(true))
.addReg(NewVRD, getKillRegState(true)); .addReg(NewVRD, getKillRegState(true));
// update flags for new created instructions. // Update flags for newly created instructions.
setSpecialOperandAttr(*MINewA, IntersectedFlags); setSpecialOperandAttr(*MINewA, IntersectedFlags);
setSpecialOperandAttr(*MINewB, IntersectedFlags); setSpecialOperandAttr(*MINewB, IntersectedFlags);
setSpecialOperandAttr(*MINewD, IntersectedFlags); setSpecialOperandAttr(*MINewD, IntersectedFlags);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment