[AArch64] Don't generate libcalls for wide shifts on Darwin
authorJessica Paquette <jpaquette@apple.com>
Fri, 10 Jan 2020 23:46:52 +0000 (15:46 -0800)
committerJessica Paquette <jpaquette@apple.com>
Fri, 10 Jan 2020 23:58:51 +0000 (15:58 -0800)
Similar to cff90f07cb5cc3.

Darwin doesn't always use compiler-rt, and so we can't assume that these
functions are available (at least on arm64).

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/shift_minsize.ll

index 4086595..0fa1b76 100644 (file)
@@ -13102,7 +13102,7 @@ bool AArch64TargetLowering::
 bool AArch64TargetLowering::shouldExpandShift(SelectionDAG &DAG,
                                               SDNode *N) const {
   if (DAG.getMachineFunction().getFunction().hasMinSize() &&
-      !Subtarget->isTargetWindows())
+      !Subtarget->isTargetWindows() && !Subtarget->isTargetDarwin())
     return false;
   return true;
 }
index 2728b3f..ac48975 100644 (file)
@@ -1,11 +1,16 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=aarch64-unknown-unknown | FileCheck %s
 ; RUN: llc < %s -mtriple=aarch64-windows         | FileCheck %s -check-prefix=CHECK-WIN
+; RUN: llc < %s -mtriple=aarch64-apple-darwin    | FileCheck %s -check-prefix=CHECK-DARWIN
 
 ; The Windows runtime doesn't have these.
 ; CHECK-WIN-NOT: __ashlti3
 ; CHECK-WIN-NOT: __ashrti3
 
+; Darwin compiler-rt excludes these.
+; CHECK-DARWIN-NOT: __ashlti3
+; CHECK-DARWIN-NOT: __ashrti3
+
 define i64 @f0(i64 %val, i64 %amt) minsize optsize {
 ; CHECK-LABEL: f0:
 ; CHECK:       // %bb.0: