[llvm] r282186 - i386 does not support optimized swifterror handling

Arnold Schwaighofer via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 13:06:25 PDT 2016


Author: arnolds
Date: Thu Sep 22 15:06:25 2016
New Revision: 282186

URL: http://llvm.org/viewvc/llvm-project?rev=282186&view=rev
Log:
i386 does not support optimized swifterror handling

rdar://28432565

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.h
    llvm/trunk/test/CodeGen/X86/swifterror.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=282186&r1=282185&r2=282186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Sep 22 15:06:25 2016
@@ -32573,3 +32573,7 @@ void X86TargetLowering::insertCopiesSpli
           .addReg(NewVR);
   }
 }
+
+bool X86TargetLowering::supportSwiftError() const {
+  return Subtarget.is64Bit();
+}

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=282186&r1=282185&r2=282186&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Thu Sep 22 15:06:25 2016
@@ -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>

Modified: llvm/trunk/test/CodeGen/X86/swifterror.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/swifterror.ll?rev=282186&r1=282185&r2=282186&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/swifterror.ll (original)
+++ llvm/trunk/test/CodeGen/X86/swifterror.ll Thu Sep 22 15:06:25 2016
@@ -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
+}




More information about the llvm-commits mailing list