Skip to content

Commit 882720b

Browse files
committed
Don't generate libcalls for wide shift on Windows ARM (PR42711)
The previous patch (cff90f0) didn't cover ARM. (cherry picked from commit decd021)
1 parent c6f940b commit 882720b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16892,7 +16892,7 @@ bool ARMTargetLowering::isCheapToSpeculateCtlz() const {
1689216892
}
1689316893

1689416894
bool ARMTargetLowering::shouldExpandShift(SelectionDAG &DAG, SDNode *N) const {
16895-
return !Subtarget->hasMinSize();
16895+
return !Subtarget->hasMinSize() || Subtarget->isTargetWindows();
1689616896
}
1689716897

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

llvm/test/CodeGen/ARM/shift_minsize.ll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
1+
; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
2+
; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-prefix=CHECK-WIN
3+
4+
; The Windows runtime doesn't have these.
5+
; CHECK-WIN-NOT: __ashldi3
6+
; CHECK-WIN-NOT: __ashrdi3
7+
; CHECK-WIN-NOT: __lshrdi3
28

39
define i64 @f0(i64 %val, i64 %amt) minsize optsize {
410
; CHECK-LABEL: f0:

0 commit comments

Comments
 (0)