[llvm] r217735 - [A57FPLoadBalancing] Modify r217689 - actually we do need to check defs

James Molloy james.molloy at arm.com
Sun Sep 14 11:24:26 PDT 2014


Author: jamesm
Date: Sun Sep 14 13:24:26 2014
New Revision: 217735

URL: http://llvm.org/viewvc/llvm-project?rev=217735&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp?rev=217735&r1=217734&r2=217735&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp Sun Sep 14 13:24:26 2014
@@ -582,7 +582,9 @@ scanInstruction(MachineInstr *MI, unsign
 
   if (isMul(MI)) {
 
-    for (auto &I : MI->operands())
+    for (auto &I : MI->uses())
+      maybeKillChain(I, Idx, ActiveChains);
+    for (auto &I : MI->defs())
       maybeKillChain(I, Idx, ActiveChains);
 
     // Create a new chain. Multiplies don't require forwarding so can go on any
@@ -644,7 +646,9 @@ scanInstruction(MachineInstr *MI, unsign
 
     // Non-MUL or MLA instruction. Invalidate any chain in the uses or defs
     // lists.
-    for (auto &I : MI->operands())
+    for (auto &I : MI->uses())
+      maybeKillChain(I, Idx, ActiveChains);
+    for (auto &I : MI->defs())
       maybeKillChain(I, Idx, ActiveChains);
 
   }
@@ -657,10 +661,6 @@ maybeKillChain(MachineOperand &MO, unsig
   // determine if a chain should be ended and remove from ActiveChains.
   MachineInstr *MI = MO.getParent();
 
-  if (MO.isReg() && MO.isDef())
-    // We don't care about defs. We see them before uses, so reject them early.
-    return;
-
   if (MO.isReg()) {
 
     // If this is a KILL of a current chain, record it.





More information about the llvm-commits mailing list