summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CallingConvLower.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2022-02-26 20:29:16 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2022-02-26 20:32:12 +0100
commit1de11fe3600052d0cbc6c1f7c0ebd157348cc613 (patch)
tree8405b213ebd2ef4d43e4dbbea76c990a602d8fd0 /llvm/lib/CodeGen/CallingConvLower.cpp
parentb474ca1d5a445cdfa924d794439013bea1599f92 (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.cpp12
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;
}