Skip to content

Commit decd021

Browse files
committed
Don't generate libcalls for wide shift on Windows ARM (PR42711)
The previous patch (cff90f0) didn't cover ARM.
1 parent 7a7eacc commit decd021

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
@@ -17222,7 +17222,7 @@ bool ARMTargetLowering::isCheapToSpeculateCtlz() const {
1722217222
}
1722317223

1722417224
bool ARMTargetLowering::shouldExpandShift(SelectionDAG &DAG, SDNode *N) const {
17225-
return !Subtarget->hasMinSize();
17225+
return !Subtarget->hasMinSize() || Subtarget->isTargetWindows();
1722617226
}
1722717227

1722817228
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)