Skip to content

Commit 60043c2

Browse files
committed
fixup! [ModuloSchedule] Implement modulo variable expansion for pipelining
1 parent 5e85080 commit 60043c2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9808,6 +9808,17 @@ static bool getIndVarInfo(Register Reg, const MachineBasicBlock *LoopBB,
98089808
MachineInstr *&UpdateInst,
98099809
unsigned &UpdateCounterOprNum, Register &InitReg,
98109810
bool &IsUpdatePriorComp) {
9811+
// Example:
9812+
//
9813+
// Preheader:
9814+
// InitReg = ...
9815+
// LoopBB:
9816+
// Reg0 = PHI (InitReg, Preheader), (Reg1, LoopBB)
9817+
// Reg = COPY Reg0 ; COPY is ignored.
9818+
// Reg1 = ADD Reg, #1; UpdateInst. Incremented by a loop invariant value.
9819+
// ; Reg is the value calculated in the previous
9820+
// ; iteration, so IsUpdatePriorComp == false.
9821+
98119822
if (LoopBB->pred_size() != 2)
98129823
return false;
98139824
if (!Reg.isVirtual())
@@ -9823,6 +9834,9 @@ static bool getIndVarInfo(Register Reg, const MachineBasicBlock *LoopBB,
98239834
if (Def->getParent() != LoopBB)
98249835
return false;
98259836
if (Def->isCopy()) {
9837+
// Ignore copy instructions unless they contain subregisters
9838+
if (Def->getOperand(0).getSubReg() || Def->getOperand(1).getSubReg())
9839+
return false;
98269840
CurReg = Def->getOperand(1).getReg();
98279841
} else if (Def->isPHI()) {
98289842
if (InitReg != 0)

0 commit comments

Comments
 (0)