[llvm] [GlobalISel][AArch64] Add libcall lowering for fpowi. (PR #67114)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 09:34:49 PDT 2023


================
@@ -0,0 +1,1422 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
+; RUN: llc -mtriple=aarch64-none-eabi -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
+; RUN: llc -mtriple=aarch64-none-eabi -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
+
+define double @powi_f64(double %a, i32 %b) {
+; CHECK-SD-LABEL: powi_f64:
+; CHECK-SD:       // %bb.0: // %entry
+; CHECK-SD-NEXT:    b __powidf2
+;
+; CHECK-GI-LABEL: powi_f64:
+; CHECK-GI:       // %bb.0: // %entry
+; CHECK-GI-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
+; CHECK-GI-NEXT:    .cfi_def_cfa_offset 16
+; CHECK-GI-NEXT:    .cfi_offset w30, -16
+; CHECK-GI-NEXT:    bl __powidf2
----------------
aemerson wrote:

Ideally we should be tail-calling these. We already can do this for memcpy libcalls, could you add support in `createLibCall()`? I think you might just need to copy:
```
  Info.IsTailCall = MI.getOperand(MI.getNumOperands() - 1).getImm() &&
                    isLibCallInTailPosition(MI, MIRBuilder.getTII(), MRI);
```
from `createMemLibcall()`

https://github.com/llvm/llvm-project/pull/67114


More information about the llvm-commits mailing list