summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CallingConvLower.cpp
diff options
context:
space:
mode:
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;
}