mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
4097ff94d8
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
17 lines
682 B
LLVM
17 lines
682 B
LLVM
; RUN: not opt -S -verify < %s 2>&1 | FileCheck %s
|
|
|
|
;; Global variables cannot be scalable vectors, since we don't
|
|
;; know the size at compile time.
|
|
|
|
; CHECK: Globals cannot contain scalable vectors
|
|
; CHECK-NEXT: <vscale x 4 x i32>* @ScalableVecGlobal
|
|
@ScalableVecGlobal = global <vscale x 4 x i32> zeroinitializer
|
|
|
|
; CHECK-NEXT: Globals cannot contain scalable vectors
|
|
; CHECK-NEXT: { i32, <vscale x 4 x i32> }* @ScalableVecStructGlobal
|
|
@ScalableVecStructGlobal = global { i32, <vscale x 4 x i32> } zeroinitializer
|
|
|
|
;; Global _pointers_ to scalable vectors are fine
|
|
; CHECK-NOT: Globals cannot contain scalable vectors
|
|
@ScalableVecPtr = global <vscale x 8 x i16>* zeroinitializer
|