[llvm] r314128 - ARM: One more fix for swifterror CSR set
Arnold Schwaighofer via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 25 10:51:33 PDT 2017
Author: arnolds
Date: Mon Sep 25 10:51:33 2017
New Revision: 314128
URL: http://llvm.org/viewvc/llvm-project?rev=314128&view=rev
Log:
ARM: One more fix for swifterror CSR set
We use a differently ordered CSR set if the frame pointer is pushed. Add a
matching ..._SwiftError version.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/trunk/lib/Target/ARM/ARMCallingConv.td
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=314128&r1=314127&r2=314128&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon Sep 25 10:51:33 2017
@@ -93,9 +93,13 @@ ARMBaseRegisterInfo::getCalleeSavedRegs(
}
if (STI.getTargetLowering()->supportSwiftError() &&
- F->getAttributes().hasAttrSomewhere(Attribute::SwiftError))
- return STI.isTargetDarwin() ? CSR_iOS_SwiftError_SaveList
- : CSR_AAPCS_SwiftError_SaveList;
+ F->getAttributes().hasAttrSomewhere(Attribute::SwiftError)) {
+ if (STI.isTargetDarwin())
+ return CSR_iOS_SwiftError_SaveList;
+
+ return UseSplitPush ? CSR_AAPCS_SplitPush_SwiftError_SaveList :
+ CSR_AAPCS_SwiftError_SaveList;
+ }
if (STI.isTargetDarwin() && F->getCallingConv() == CallingConv::CXX_FAST_TLS)
return MF->getInfo<ARMFunctionInfo>()->isSplitCSR()
Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=314128&r1=314127&r2=314128&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Mon Sep 25 10:51:33 2017
@@ -258,6 +258,10 @@ def CSR_AAPCS_SplitPush : CalleeSavedReg
R11, R10, R9, R8,
(sequence "D%u", 15, 8))>;
+// R8 is used to pass swifterror, remove it from CSR.
+def CSR_AAPCS_SplitPush_SwiftError : CalleeSavedRegs<(sub CSR_AAPCS_SplitPush,
+ R8)>;
+
// Constructors and destructors return 'this' in the ARM C++ ABI; since 'this'
// and the pointer return value are both passed in R0 in these cases, this can
// be partially modelled by treating R0 as a callee-saved register
More information about the llvm-commits
mailing list