From 1de11fe3600052d0cbc6c1f7c0ebd157348cc613 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 26 Feb 2022 20:29:16 +0100 Subject: Use RegisterInfo::regsOverlaps instead of checking aliases This is both less code and faster since it doesn't have to expand all the sub & superreg sets. NFCI. --- llvm/lib/CodeGen/CallingConvLower.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'llvm/lib/CodeGen/CallingConvLower.cpp') diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/llvm/lib/CodeGen/CallingConvLower.cpp index c9246f6e8754..d51b3547565d 100644 --- a/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/llvm/lib/CodeGen/CallingConvLower.cpp @@ -72,15 +72,9 @@ bool CCState::IsShadowAllocatedReg(MCRegister Reg) const { if (!isAllocated(Reg)) return false; - for (auto const &ValAssign : Locs) { - if (ValAssign.isRegLoc()) { - for (MCRegAliasIterator AI(ValAssign.getLocReg(), &TRI, true); - AI.isValid(); ++AI) { - if (*AI == Reg) - return false; - } - } - } + for (auto const &ValAssign : Locs) + if (ValAssign.isRegLoc() && TRI.regsOverlap(ValAssign.getLocReg(), Reg)) + return false; return true; } -- cgit v1.2.3