[llvm-commits] [llvm] r158563 - in /llvm/trunk/lib/CodeGen: LiveRegMatrix.cpp LiveRegMatrix.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jun 15 15:24:22 PDT 2012


Author: stoklund
Date: Fri Jun 15 17:24:22 2012
New Revision: 158563

URL: http://llvm.org/viewvc/llvm-project?rev=158563&view=rev
Log:
Accept null PhysReg arguments to checkRegMaskInterference.

Calling checkRegMaskInterference(VirtReg) checks if VirtReg crosses any
regmask operands, regardless of the registers they clobber.

Modified:
    llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
    llvm/trunk/lib/CodeGen/LiveRegMatrix.h

Modified: llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp?rev=158563&r1=158562&r2=158563&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp Fri Jun 15 17:24:22 2012
@@ -110,7 +110,7 @@
   // The BitVector is indexed by PhysReg, not register unit.
   // Regmask interference is more fine grained than regunits.
   // For example, a Win64 call can clobber %ymm8 yet preserve %xmm8.
-  return !RegMaskUsable.empty() && !RegMaskUsable.test(PhysReg);
+  return !RegMaskUsable.empty() && (!PhysReg || !RegMaskUsable.test(PhysReg));
 }
 
 bool LiveRegMatrix::checkRegUnitInterference(LiveInterval &VirtReg,

Modified: llvm/trunk/lib/CodeGen/LiveRegMatrix.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRegMatrix.h?rev=158563&r1=158562&r2=158563&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRegMatrix.h (original)
+++ llvm/trunk/lib/CodeGen/LiveRegMatrix.h Fri Jun 15 17:24:22 2012
@@ -124,7 +124,8 @@
 
   /// Check for regmask interference only.
   /// Return true if VirtReg crosses a regmask operand that clobbers PhysReg.
-  bool checkRegMaskInterference(LiveInterval &VirtReg, unsigned PhysReg);
+  /// If PhysReg is null, check if VirtReg crosses any regmask operands.
+  bool checkRegMaskInterference(LiveInterval &VirtReg, unsigned PhysReg = 0);
 
   /// Check for regunit interference only.
   /// Return true if VirtReg overlaps a fixed assignment of one of PhysRegs's





More information about the llvm-commits mailing list