diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2022-02-26 20:29:16 +0100 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2022-02-26 20:32:12 +0100 |
| commit | 1de11fe3600052d0cbc6c1f7c0ebd157348cc613 (patch) | |
| tree | 8405b213ebd2ef4d43e4dbbea76c990a602d8fd0 /llvm/lib/CodeGen/CallingConvLower.cpp | |
| parent | b474ca1d5a445cdfa924d794439013bea1599f92 (diff) | |
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.
Diffstat (limited to 'llvm/lib/CodeGen/CallingConvLower.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/CallingConvLower.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
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; } |
