Skip to content

Commit ceb8016

Browse files
author
Jessica Paquette
committed
[AArch64] Don't generate libcalls for wide shifts on Darwin
Similar to cff90f0. Darwin doesn't always use compiler-rt, and so we can't assume that these functions are available (at least on arm64).
1 parent 1b8c84b commit ceb8016

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13102,7 +13102,7 @@ bool AArch64TargetLowering::
1310213102
bool AArch64TargetLowering::shouldExpandShift(SelectionDAG &DAG,
1310313103
SDNode *N) const {
1310413104
if (DAG.getMachineFunction().getFunction().hasMinSize() &&
13105-
!Subtarget->isTargetWindows())
13105+
!Subtarget->isTargetWindows() && !Subtarget->isTargetDarwin())
1310613106
return false;
1310713107
return true;
1310813108
}

llvm/test/CodeGen/AArch64/shift_minsize.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc < %s -mtriple=aarch64-unknown-unknown | FileCheck %s
33
; RUN: llc < %s -mtriple=aarch64-windows | FileCheck %s -check-prefix=CHECK-WIN
4+
; RUN: llc < %s -mtriple=aarch64-apple-darwin | FileCheck %s -check-prefix=CHECK-DARWIN
45

56
; The Windows runtime doesn't have these.
67
; CHECK-WIN-NOT: __ashlti3
78
; CHECK-WIN-NOT: __ashrti3
89

10+
; Darwin compiler-rt excludes these.
11+
; CHECK-DARWIN-NOT: __ashlti3
12+
; CHECK-DARWIN-NOT: __ashrti3
13+
914
define i64 @f0(i64 %val, i64 %amt) minsize optsize {
1015
; CHECK-LABEL: f0:
1116
; CHECK: // %bb.0:

0 commit comments

Comments
 (0)