i386 does not support optimized swifterror handling

rdar://28432565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Arnold Schwaighofer 2016-09-22 20:06:25 +00:00
parent ba9e1e6b25
commit d1714b5989
3 changed files with 22 additions and 3 deletions

View File

@ -32573,3 +32573,7 @@ void X86TargetLowering::insertCopiesSplitCSR(
.addReg(NewVR);
}
}
bool X86TargetLowering::supportSwiftError() const {
return Subtarget.is64Bit();
}

View File

@ -1022,9 +1022,7 @@ namespace llvm {
bool isIntDivCheap(EVT VT, AttributeSet Attr) const override;
bool supportSwiftError() const override {
return true;
}
bool supportSwiftError() const override;
protected:
std::pair<const TargetRegisterClass *, uint8_t>

View File

@ -1,5 +1,6 @@
; RUN: llc -verify-machineinstrs < %s -mtriple=x86_64-apple-darwin | FileCheck --check-prefix=CHECK-APPLE %s
; RUN: llc -verify-machineinstrs -O0 < %s -mtriple=x86_64-apple-darwin | FileCheck --check-prefix=CHECK-O0 %s
; RUN: llc -verify-machineinstrs < %s -mtriple=i386-apple-darwin | FileCheck --check-prefix=CHECK-i386 %s
declare i8* @malloc(i64)
declare void @free(i8*)
@ -478,3 +479,19 @@ entry:
%0 = tail call swiftcc float @tailcallswifterror_swiftcc(%swift_error** swifterror %error_ptr_ref)
ret float %0
}
; Check that we can handle an empty function with swifterror argument.
; CHECK-i386-LABEL: empty_swiftcc:
; CHECK-i386: movl 4(%esp), %eax
; CHECK-i386: movl 8(%esp), %edx
; CHECK-i386: movl 12(%esp), %ecx
; CHECK-i386: retl
; CHECK-APPLE-LABEL: empty_swiftcc:
; CHECK-APPLE: movl %edx, %ecx
; CHECK-APPLE: movl %edi, %eax
; CHECK-APPLE: movl %esi, %edx
; CHECK-APPLE: retq
define swiftcc {i32, i32, i32} @empty_swiftcc({i32, i32, i32} , %swift_error** swifterror %error_ptr_ref) {
entry:
ret {i32, i32, i32} %0
}