Skip to content

Commit 2ba016c

Browse files
committed
[arm][darwin] Don't generate libcalls for wide shifts on Darwin
Similar to ceb8016. Darwin doesn't always use compiler-rt, and so we can't assume that these functions are available on arm.
1 parent c3f0d9f commit 2ba016c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17958,7 +17958,8 @@ bool ARMTargetLowering::isCheapToSpeculateCtlz() const {
1795817958
}
1795917959

1796017960
bool ARMTargetLowering::shouldExpandShift(SelectionDAG &DAG, SDNode *N) const {
17961-
return !Subtarget->hasMinSize() || Subtarget->isTargetWindows();
17961+
return !Subtarget->hasMinSize() || Subtarget->isTargetWindows() ||
17962+
Subtarget->isTargetDarwin();
1796217963
}
1796317964

1796417965
Value *ARMTargetLowering::emitLoadLinked(IRBuilder<> &Builder, Value *Addr,

llvm/test/CodeGen/ARM/shift_minsize.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
22
; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-prefix=CHECK-WIN
3+
; RUN: llc < %s -mtriple=aarch64-apple-darwin | FileCheck %s -check-prefix=CHECK-DARWIN
34

45
; The Windows runtime doesn't have these.
56
; CHECK-WIN-NOT: __ashldi3
67
; CHECK-WIN-NOT: __ashrdi3
78
; CHECK-WIN-NOT: __lshrdi3
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: bl __aeabi_llsl

0 commit comments

Comments
 (0)