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

Kiran Chandramohan via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 10:27:11 PST 2024


kiranchandramohan wrote:

@davemgreen The patch seems to have some issues with the Windows target. The dump after the legalizer prints BL without symbol as given below.
```
BL &"", <regmask $fp $lr $wzr $xzr $b8 $b9 $b10 $b11 $b12 $b13 $b14 $b15 $d8 $d9 $d10 $d11 $d12 $d13 $d14 $d15 $h8 $h9 $h10 $h11 $h12 $h13 $h14 $h15 $s8 $s9 $s10 $s11 $s12 and 55 more...>, implicit-def $lr, implicit $sp, implicit $d0, implicit $w0, implicit-def $d0
``

It works fine on the linux target and prints (BL &__powidf2 .....).

Could you have a look?

Reproducer:
```
; ModuleID = 'LLVMDialectModule'
source_filename = "LLVMDialectModule"
target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-pc-windows-msvc19.37.32822"

@_QFpf07aaECtwo = internal constant double 2.000000e+00
@_QFpf07aaECwp = internal constant i32 8

define void @pf07aa_() {
  %1 = alloca i32, i64 1, align 4
  %2 = alloca double, i64 1, align 8
  %3 = load i32, ptr %1, align 4
  %4 = call contract double @llvm.powi.f64.i32(double 2.000000e+00, i32 %3)
  store double %4, ptr %2, align 8
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.powi.f64.i32(double, i32) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none)
```

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


More information about the llvm-commits mailing list