mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[ModuloSchedule] Pass loop block explicitly to kernel rewriter.
This change is NFC upstream. We pass in the loop's block to the kernel rewriter explicitly, instead of assuming it's the loop's top block. This change is made for downstream targets where this assumption doesn't hold. Differential Revision: https://reviews.llvm.org/D104811
This commit is contained in:
parent
804aeeb5ec
commit
36b5d3f1af
@ -1275,15 +1275,15 @@ class KernelRewriter {
|
|||||||
Register undef(const TargetRegisterClass *RC);
|
Register undef(const TargetRegisterClass *RC);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KernelRewriter(MachineLoop &L, ModuloSchedule &S,
|
KernelRewriter(MachineLoop &L, ModuloSchedule &S, MachineBasicBlock *LoopBB,
|
||||||
LiveIntervals *LIS = nullptr);
|
LiveIntervals *LIS = nullptr);
|
||||||
void rewrite();
|
void rewrite();
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
KernelRewriter::KernelRewriter(MachineLoop &L, ModuloSchedule &S,
|
KernelRewriter::KernelRewriter(MachineLoop &L, ModuloSchedule &S,
|
||||||
LiveIntervals *LIS)
|
MachineBasicBlock *LoopBB, LiveIntervals *LIS)
|
||||||
: S(S), BB(L.getTopBlock()), PreheaderBB(L.getLoopPreheader()),
|
: S(S), BB(LoopBB), PreheaderBB(L.getLoopPreheader()),
|
||||||
ExitBB(L.getExitBlock()), MRI(BB->getParent()->getRegInfo()),
|
ExitBB(L.getExitBlock()), MRI(BB->getParent()->getRegInfo()),
|
||||||
TII(BB->getParent()->getSubtarget().getInstrInfo()), LIS(LIS) {
|
TII(BB->getParent()->getSubtarget().getInstrInfo()), LIS(LIS) {
|
||||||
PreheaderBB = *BB->pred_begin();
|
PreheaderBB = *BB->pred_begin();
|
||||||
@ -1981,7 +1981,7 @@ void PeelingModuloScheduleExpander::fixupBranches() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PeelingModuloScheduleExpander::rewriteKernel() {
|
void PeelingModuloScheduleExpander::rewriteKernel() {
|
||||||
KernelRewriter KR(*Schedule.getLoop(), Schedule);
|
KernelRewriter KR(*Schedule.getLoop(), Schedule, BB);
|
||||||
KR.rewrite();
|
KR.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2024,7 +2024,7 @@ void PeelingModuloScheduleExpander::validateAgainstModuloScheduleExpander() {
|
|||||||
Preheader->addSuccessor(BB);
|
Preheader->addSuccessor(BB);
|
||||||
|
|
||||||
// Now run the new expansion algorithm.
|
// Now run the new expansion algorithm.
|
||||||
KernelRewriter KR(*Schedule.getLoop(), Schedule);
|
KernelRewriter KR(*Schedule.getLoop(), Schedule, BB);
|
||||||
KR.rewrite();
|
KR.rewrite();
|
||||||
peelPrologAndEpilogs();
|
peelPrologAndEpilogs();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user