[PATCH] D109163: [AArch64][sve] Prevent incorrect function call on fixed width vector
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 3 08:28:46 PDT 2021
paulwalker-arm added inline comments.
================
Comment at: llvm/test/CodeGen/AArch64/sve-no-typesize-warnings.ll:34
+
+attributes #0 = { "target-features"="+sve" }
----------------
bsmith wrote:
> This test is missing a vscale_range attribute that would have triggered the assertion failure
The test also looks more complicated than need be. I've had a play and came up with:
```
; RUN: llc < %s | FileCheck %s
target triple = "aarch64-unknown-linux-gnu"
define <4 x i32> @sve_no_typesize_warning(<vscale x 8 x i16> %a, <4 x i16> %b) #0 {
%a.lo = call <4 x i16> @llvm.experimental.vector.extract.v4i16.nxv8i16(<vscale x 8 x i16> %a, i64 0)
%a.lo.zext = zext <4 x i16> %a.lo to <4 x i32>
%b.zext = zext <4 x i16> %b to <4 x i32>
%add = add <4 x i32> %a.lo.zext, %b.zext
ret <4 x i32> %add
}
declare <4 x i16> @llvm.experimental.vector.extract.v4i16.nxv8i16(<vscale x 8 x i16>, i64)
attributes #0 = { "target-features"="+sve" }
```
Which looks to do the job. The test is using only scalable and NEON fixed length types so there's no need for vscale_range.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109163/new/
https://reviews.llvm.org/D109163
More information about the llvm-commits
mailing list