1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Verifier/scalable-vector-struct-load.ll
Craig Topper 4097ff94d8 [IR] Allow scalable vectors in structs to support intrinsics returning multiple values.
RISC-V would like to use a struct of scalable vectors to return multiple
values from intrinsics. This woud also be needed for target independent
intrinsics like llvm.sadd.overflow.

This patch removes the existing restriction for this. I've modified
StructType::isSized to consider a struct containing scalable vectors
as unsized so the verifier won't allow loads/stores/allocas of these
structs.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D94142
2021-01-17 23:29:51 -08:00

9 lines
329 B
LLVM

; RUN: not opt -S -verify < %s 2>&1 | FileCheck %s
define <vscale x 1 x i32> @load({ i32, <vscale x 1 x i32> }* %x) {
; CHECK: error: loading unsized types is not allowed
%a = load { i32, <vscale x 1 x i32> }, { i32, <vscale x 1 x i32> }* %x
%b = extractvalue { i32, <vscale x 1 x i32> } %a, 1
ret <vscale x 1 x i32> %b
}