llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.61k stars 11.35k forks source link

[AArch64] Cannot select: t4: nxv4bf16 = fp_round t2, TargetConstant:i64<0> #94951

Open d0k opened 2 months ago

d0k commented 2 months ago

Loop vectorizer creates these vectors if there are bf16 types in the input

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64-unknown-linux-gnu"

define <vscale x 4 x bfloat> @Conv.9(<vscale x 4 x float> %wide.masked.load) {
  %f = fptrunc <vscale x 4 x float> %wide.masked.load to <vscale x 4 x bfloat>
  ret <vscale x 4 x bfloat> %f
}
$ llc -mtriple=aarch64-linux-gnu -mcpu=neoverse-n2 < t.ll
LLVM ERROR: Cannot select: t4: nxv4bf16 = fp_round t2, TargetConstant:i64<0>
  t2: nxv4f32,ch = CopyFromReg t0, Register:nxv4f32 %0
    t1: nxv4f32 = Register %0
  t3: i64 = TargetConstant<0>
In function: Conv.9
llvmbot commented 2 months ago

@llvm/issue-subscribers-backend-aarch64

Author: Benjamin Kramer (d0k)

Loop vectorizer creates these vectors if there are bf16 types in the input ``` target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" target triple = "aarch64-unknown-linux-gnu" define <vscale x 4 x bfloat> @Conv.9(<vscale x 4 x float> %wide.masked.load) { %f = fptrunc <vscale x 4 x float> %wide.masked.load to <vscale x 4 x bfloat> ret <vscale x 4 x bfloat> %f } ``` ``` $ llc -mtriple=aarch64-linux-gnu -mcpu=neoverse-n2 < t.ll LLVM ERROR: Cannot select: t4: nxv4bf16 = fp_round t2, TargetConstant:i64<0> t2: nxv4f32,ch = CopyFromReg t0, Register:nxv4f32 %0 t1: nxv4f32 = Register %0 t3: i64 = TargetConstant<0> In function: Conv.9 ```