1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/AArch64/sve-bad-intrinsics.ll
David Sherwood a79399564d [SVE] Fix wrong usage of getNumElements() in matchIntrinsicType
I have changed the ScalableVecArgument case in matchIntrinsicType
to create a new FixedVectorType. This means that the next case we
hit (Vector) will not assert when calling getNumElements(), since
we know that it's always a FixedVectorType. This is a temporary
measure for now, and it will be fixed properly in another patch
that refactors this code.

The changes are covered by this existing test:

CodeGen/AArch64/sve-intrinsics-fp-converts.ll

In addition, I have added a new test to ensure that we correctly
reject SVE intrinsics when called with fixed length vector types.

Differential Revision: https://reviews.llvm.org/D79416
2020-05-15 08:44:59 +01:00

18 lines
660 B
LLVM

; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t
; RUN: FileCheck --check-prefix=CHECK-ERROR %s <%t
declare <4 x float> @llvm.arm.neon.vcvthf2fp(<vscale x 4 x i16>)
declare <vscale x 4 x i16> @llvm.arm.neon.vcvtfp2hf(<vscale x 4 x float>)
; CHECK-ERROR: Intrinsic has incorrect return type!
define <vscale x 4 x i16> @bad1() {
%r = call <vscale x 4 x i16> @llvm.arm.neon.vcvtfp2hf(<vscale x 4 x float> zeroinitializer)
ret <vscale x 4 x i16> %r
}
; CHECK-ERROR: Intrinsic has incorrect argument type!
define <4 x float> @bad2() {
%r = call <4 x float> @llvm.arm.neon.vcvthf2fp(<vscale x 4 x i16> zeroinitializer)
ret <4 x float> %r
}