[llvm-commits] [llvm] r130714 - /llvm/trunk/lib/CodeGen/RegisterScavenging.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon May 2 13:06:28 PDT 2011


Author: stoklund
Date: Mon May  2 15:06:28 2011
New Revision: 130714

URL: http://llvm.org/viewvc/llvm-project?rev=130714&view=rev
Log:
Only ignore <undef> use operands, keep the <def,undef> ops.

Def operands may also have an <undef> flag, but that just means that a
sub-register redef doesn't actually read the super-register. For physical
registers, it has no meaning.

Modified:
    llvm/trunk/lib/CodeGen/RegisterScavenging.cpp

Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=130714&r1=130713&r2=130714&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Mon May  2 15:06:28 2011
@@ -154,13 +154,16 @@
   BitVector DeadRegs(NumPhysRegs);
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
     const MachineOperand &MO = MI->getOperand(i);
-    if (!MO.isReg() || MO.isUndef())
+    if (!MO.isReg())
       continue;
     unsigned Reg = MO.getReg();
     if (!Reg || isReserved(Reg))
       continue;
 
     if (MO.isUse()) {
+      // Ignore undef uses.
+      if (MO.isUndef())
+        continue;
       // Two-address operands implicitly kill.
       if (!isPred && (MO.isKill() || MI->isRegTiedToDefOperand(i)))
         addRegWithSubRegs(KillRegs, Reg);





More information about the llvm-commits mailing list