mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
When the scheduler unfold a load folding instruction it move some of the predecessors to the unfolded load. It decides what gets moved to the load by checking whether the new load is using the predecessor as an operand. The check neglects the cases whether the predecessor is a flagged scheduling unit.
rdar://7604000 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -345,6 +345,15 @@ void ScheduleDAGRRList::BacktrackBottomUp(SUnit *SU, unsigned BtCycle,
|
||||
++NumBacktracks;
|
||||
}
|
||||
|
||||
static bool isOperandOf(const SUnit *SU, SDNode *N) {
|
||||
for (const SDNode *SUNode = SU->getNode(); SUNode;
|
||||
SUNode = SUNode->getFlaggedNode()) {
|
||||
if (SUNode->isOperandOf(N))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// CopyAndMoveSuccessors - Clone the specified node and move its scheduled
|
||||
/// successors to the newly created node.
|
||||
SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) {
|
||||
@@ -427,8 +436,7 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) {
|
||||
I != E; ++I) {
|
||||
if (I->isCtrl())
|
||||
ChainPreds.push_back(*I);
|
||||
else if (I->getSUnit()->getNode() &&
|
||||
I->getSUnit()->getNode()->isOperandOf(LoadNode))
|
||||
else if (isOperandOf(I->getSUnit(), LoadNode))
|
||||
LoadPreds.push_back(*I);
|
||||
else
|
||||
NodePreds.push_back(*I);
|
||||
|
Reference in New Issue
Block a user