Accept null PhysReg arguments to checkRegMaskInterference.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 15 Jun 2012 22:24:22 +0000 (22:24 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 15 Jun 2012 22:24:22 +0000 (22:24 +0000)
Calling checkRegMaskInterference(VirtReg) checks if VirtReg crosses any
regmask operands, regardless of the registers they clobber.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158563 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveRegMatrix.cpp
lib/CodeGen/LiveRegMatrix.h

index 61e1432b0e2fc21132479650877f264df01cbe19..cdb17768129c42b48a488eb2d623431906e9eb81 100644 (file)
@@ -110,7 +110,7 @@ bool LiveRegMatrix::checkRegMaskInterference(LiveInterval &VirtReg,
   // 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,
index 4c3e7d47821aa84c48502199e433b2a815784071..019a5f5877e6749682c109386050298c6436e9db 100644 (file)
@@ -124,7 +124,8 @@ public:
 
   /// 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