From: Matt Arsenault Date: Fri, 22 Feb 2019 19:03:31 +0000 (+0000) Subject: LiveIntervals: Add removeAllRegUnitsForPhysReg X-Git-Tag: llvmorg-10-init~11385 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45cfe9822d8d4401c7998351e54a159a19c09bad;p=platform%2Fupstream%2Fllvm.git LiveIntervals: Add removeAllRegUnitsForPhysReg Convenience wrapper for removing the reg units of a physical register. llvm-svn: 354685 --- diff --git a/llvm/include/llvm/CodeGen/LiveIntervals.h b/llvm/include/llvm/CodeGen/LiveIntervals.h index d0791be..588b0f9 100644 --- a/llvm/include/llvm/CodeGen/LiveIntervals.h +++ b/llvm/include/llvm/CodeGen/LiveIntervals.h @@ -417,6 +417,15 @@ class VirtRegMap; RegUnitRanges[Unit] = nullptr; } + /// Remove associated live ranges for the register units associated with \p + /// Reg. Subsequent uses should rely on on-demand recomputation. \note This + /// method can result in inconsistent liveness tracking if multiple phyical + /// registers share a regunit, and should be used cautiously. + void removeAllRegUnitsForPhysReg(unsigned Reg) { + for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) + removeRegUnit(*Units); + } + /// Remove value numbers and related live segments starting at position /// \p Pos that are part of any liverange of physical register \p Reg or one /// of its subregisters.