Skip to content

Commit 05ce999

Browse files
author
James Molloy
committed
[A57FPLoadBalancing] Modify r217689 - actually we do need to check defs
... Just make sure we check uses first so we see the kill first. It turns out ignoring defs gives some pretty nasty runtime failures. I'm certain this is the fix but I'm still reducing a testcase. llvm-svn: 217735
1 parent 279ebe2 commit 05ce999

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ scanInstruction(MachineInstr *MI, unsigned Idx,
582582

583583
if (isMul(MI)) {
584584

585-
for (auto &I : MI->operands())
585+
for (auto &I : MI->uses())
586+
maybeKillChain(I, Idx, ActiveChains);
587+
for (auto &I : MI->defs())
586588
maybeKillChain(I, Idx, ActiveChains);
587589

588590
// Create a new chain. Multiplies don't require forwarding so can go on any
@@ -644,7 +646,9 @@ scanInstruction(MachineInstr *MI, unsigned Idx,
644646

645647
// Non-MUL or MLA instruction. Invalidate any chain in the uses or defs
646648
// lists.
647-
for (auto &I : MI->operands())
649+
for (auto &I : MI->uses())
650+
maybeKillChain(I, Idx, ActiveChains);
651+
for (auto &I : MI->defs())
648652
maybeKillChain(I, Idx, ActiveChains);
649653

650654
}
@@ -657,10 +661,6 @@ maybeKillChain(MachineOperand &MO, unsigned Idx,
657661
// determine if a chain should be ended and remove from ActiveChains.
658662
MachineInstr *MI = MO.getParent();
659663

660-
if (MO.isReg() && MO.isDef())
661-
// We don't care about defs. We see them before uses, so reject them early.
662-
return;
663-
664664
if (MO.isReg()) {
665665

666666
// If this is a KILL of a current chain, record it.

0 commit comments

Comments
 (0)