[llvm] [AArch64][SVE] - Fix crash Possible incorrect use of EVT::getVectorNumElements(). (PR #218733)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 03:51:42 PDT 2026


================
@@ -0,0 +1,24 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
+
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
+target triple = "aarch64-unknown-linux-gnu"
+
+define <vscale x 8 x i32> @blend_heat_16bit(<vscale x 8 x i32> %0) #0 {
+; CHECK-LABEL: blend_heat_16bit:
+; CHECK:       // %bb.0: // %.lr.ph
+; CHECK-NEXT:    mov z2.s, #1 // =0x1
+; CHECK-NEXT:    uqsub z0.s, z2.s, z0.s
+; CHECK-NEXT:    uqsub z1.s, z2.s, z1.s
+; CHECK-NEXT:    ret
+.lr.ph:
+  %1 = call <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32> splat (i32 1), <vscale x 8 x i32> %0)
+  ret <vscale x 8 x i32> %1
+}
+
+declare <vscale x 8 x i32> @llvm.usub.sat.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>) #1
+
+attributes #0 = { "target-features"="+sve" }
+attributes #1 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
----------------
RKSimon wrote:

the forward declaration and attribs should be unnecessary

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


More information about the llvm-commits mailing list