[llvm-branch-commits] [llvm] 882720b - Don't generate libcalls for wide shift on Windows ARM (PR42711)

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 25 02:57:25 PST 2020


Author: Hans Wennborg
Date: 2020-02-25T11:54:51+01:00
New Revision: 882720b7ce338c81aa24c1c2b2614c47d248920f

URL: https://github.com/llvm/llvm-project/commit/882720b7ce338c81aa24c1c2b2614c47d248920f
DIFF: https://github.com/llvm/llvm-project/commit/882720b7ce338c81aa24c1c2b2614c47d248920f.diff

LOG: Don't generate libcalls for wide shift on Windows ARM (PR42711)

The previous patch (cff90f07cb5cc3c3bc58277926103af31caef308) didn't
cover ARM.

(cherry picked from commit decd021facba804b57e8d80b6159c987d3261ab8)

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMISelLowering.cpp
    llvm/test/CodeGen/ARM/shift_minsize.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 2f836a60a9e0..66f3f418d06c 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -16892,7 +16892,7 @@ bool ARMTargetLowering::isCheapToSpeculateCtlz() const {
 }
 
 bool ARMTargetLowering::shouldExpandShift(SelectionDAG &DAG, SDNode *N) const {
-  return !Subtarget->hasMinSize();
+  return !Subtarget->hasMinSize() || Subtarget->isTargetWindows();
 }
 
 Value *ARMTargetLowering::emitLoadLinked(IRBuilder<> &Builder, Value *Addr,

diff  --git a/llvm/test/CodeGen/ARM/shift_minsize.ll b/llvm/test/CodeGen/ARM/shift_minsize.ll
index 4d10c64392da..de7327ed3fcb 100644
--- a/llvm/test/CodeGen/ARM/shift_minsize.ll
+++ b/llvm/test/CodeGen/ARM/shift_minsize.ll
@@ -1,4 +1,10 @@
-; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
+; RUN: llc -mtriple=arm-eabi        %s -o - | FileCheck %s
+; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-prefix=CHECK-WIN
+
+; The Windows runtime doesn't have these.
+; CHECK-WIN-NOT: __ashldi3
+; CHECK-WIN-NOT: __ashrdi3
+; CHECK-WIN-NOT: __lshrdi3
 
 define i64 @f0(i64 %val, i64 %amt) minsize optsize {
 ; CHECK-LABEL:   f0:


        


More information about the llvm-branch-commits mailing list