From eb06b0b6aa627c6698471d4df71570f080fb3c5c Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 15 Jun 2012 22:24:22 +0000 Subject: Accept null PhysReg arguments to checkRegMaskInterference. 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 | 2 +- lib/CodeGen/LiveRegMatrix.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/LiveRegMatrix.cpp b/lib/CodeGen/LiveRegMatrix.cpp index 61e1432b0e..cdb1776812 100644 --- a/lib/CodeGen/LiveRegMatrix.cpp +++ b/lib/CodeGen/LiveRegMatrix.cpp @@ -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, diff --git a/lib/CodeGen/LiveRegMatrix.h b/lib/CodeGen/LiveRegMatrix.h index 4c3e7d4782..019a5f5877 100644 --- a/lib/CodeGen/LiveRegMatrix.h +++ b/lib/CodeGen/LiveRegMatrix.h @@ -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 -- cgit v1.2.3