[llvm] 2ba016c - [arm][darwin] Don't generate libcalls for wide shifts on Darwin

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 16:11:12 PDT 2020


We assume, on all targets, that there is no available 128-bit shift routine on 32-bit ARM.  (https://github.com/llvm/llvm-project/blob/ac6abc99e2794e4674a8498f817fda19b176bbfe/llvm/lib/Target/ARM/ARMISelLowering.cpp#L511 .)  And the test in question doesn't have 128-bit shifts.  So I'm not sure why you're checking for __ashlti3 (with a "t").

For the functional change, do you really have a target that's missing the 64-bit shift routines?  Any normal build of libgcc or compiler-rt should have them, and they're defined in the ARM EABI specification. I can't imagine running into issues unless you've constructed some custom runtime that intentionally cut out those routines.  And in that case, checking  "isTargetDarwin()" doesn't seem appropriate.

In the future, please get pre-commit review for this sort of change.

-Eli

> -----Original Message-----
> From: llvm-commits <llvm-commits-bounces at lists.llvm.org> On Behalf Of
> Alex Lorenz via llvm-commits
> Sent: Friday, June 5, 2020 3:42 PM
> To: llvm-commits at lists.llvm.org
> Subject: [EXT] [llvm] 2ba016c - [arm][darwin] Don't generate libcalls for wide
> shifts on Darwin
>
>
> Author: Alex Lorenz
> Date: 2020-06-05T15:41:23-07:00
> New Revision: 2ba016cd5ce50a3683d3e6c2c62f00e1cccfd8b5
>
> URL: https://github.com/llvm/llvm-
> project/commit/2ba016cd5ce50a3683d3e6c2c62f00e1cccfd8b5
> DIFF: https://github.com/llvm/llvm-
> project/commit/2ba016cd5ce50a3683d3e6c2c62f00e1cccfd8b5.diff
>
> LOG: [arm][darwin] Don't generate libcalls for wide shifts on Darwin
>
> Similar to ceb801612a678bdffe7e7bf163bd0eed9c9b73a2.
>
> Darwin doesn't always use compiler-rt, and so we can't assume that these
> functions are available on arm.
>
> 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 e4805eedbda5..0bd726ebdcf5 100644
> --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
> +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
> @@ -17958,7 +17958,8 @@ bool
> ARMTargetLowering::isCheapToSpeculateCtlz() const {
>  }
>
>  bool ARMTargetLowering::shouldExpandShift(SelectionDAG &DAG, SDNode
> *N) const {
> -  return !Subtarget->hasMinSize() || Subtarget->isTargetWindows();
> +  return !Subtarget->hasMinSize() || Subtarget->isTargetWindows() ||
> +         Subtarget->isTargetDarwin();
>  }
>
>  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 de7327ed3fcb..36434a248c4f 100644
> --- a/llvm/test/CodeGen/ARM/shift_minsize.ll
> +++ b/llvm/test/CodeGen/ARM/shift_minsize.ll
> @@ -1,11 +1,16 @@
>  ; RUN: llc -mtriple=arm-eabi        %s -o - | FileCheck %s
>  ; RUN: llc -mtriple=thumbv7-windows %s -o - | FileCheck %s -check-
> prefix=CHECK-WIN
> +; RUN: llc < %s -mtriple=aarch64-apple-darwin    | FileCheck %s -check-
> prefix=CHECK-DARWIN
>
>  ; The Windows runtime doesn't have these.
>  ; CHECK-WIN-NOT: __ashldi3
>  ; CHECK-WIN-NOT: __ashrdi3
>  ; CHECK-WIN-NOT: __lshrdi3
>
> +; Darwin compiler-rt excludes these.
> +; CHECK-DARWIN-NOT: __ashlti3
> +; CHECK-DARWIN-NOT: __ashrti3
> +
>  define i64 @f0(i64 %val, i64 %amt) minsize optsize {
>  ; CHECK-LABEL:   f0:
>  ; CHECK:         bl  __aeabi_llsl
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list