llvm / llvm-project

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

[AArch64] SVE Tracking Issue for GlobalISel #114644

Open tschuett opened 2 weeks ago

tschuett commented 2 weeks ago

Discussion and Bug Tracker for SVE support

tschuett commented 2 weeks ago

LLVM ERROR: cannot select: %0:zpr(<vscale x 4 x s16>) = G_TRUNC %2:fpr(<vscale x 4 x s32>) (in function: extract_nxv2i16_nxv4i16_1)

We select G_TRUNC in C++ and ZPR support is missing. https://github.com/llvm/llvm-project/blob/78bfcc5932fd0a39b61fe812ebed9d2f3957070b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp#L3269

tschuett commented 2 weeks ago
define <vscale x 2 x i32> @insert_vscale_2_i32_zero(<vscale x 2 x i32> %vec, i32 %elt) {
entry:
  %d = insertelement <vscale x 2 x i32> %vec, i32 %elt, i64 0
  ret <vscale x 2 x i32> %d
}

asserts with LLVM ERROR: Invalid size request on a scalable vector. in llvm::AArch64CallLowering::lowerReturn . Note the small granule.

tschuett commented 2 weeks ago

Translate legal SVE formal arguments and select COPY for SVE noted that support for illegal types and predicates are missing.

llvmbot commented 2 weeks ago

@llvm/issue-subscribers-backend-aarch64

Author: Thorsten Schütt (tschuett)

Discussion and Bug Tracker for SVE support
tschuett commented 1 week ago

Several instructions are not imported:

and more.

madhur13490 commented 1 week ago

Is this just for AArch64 or all backends which support SVE?

tschuett commented 1 week ago

It has a AArch64 label.

madhur13490 commented 1 week ago

It has a AArch64 label.

Thanks. I prefixed [AArch64] to the title.

tschuett commented 1 week ago

G_STEP_VECTOR is not available yet, see https://github.com/llvm/llvm-project/pull/114784.