[IR] Allow scalable vectors in structs to support intrinsics returning multiple values.
authorCraig Topper <craig.topper@sifive.com>
Mon, 18 Jan 2021 07:29:43 +0000 (23:29 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 18 Jan 2021 07:29:51 +0000 (23:29 -0800)
commitcfec6cd50c36f3db2fcd4084a8ef4df834a4eb24
treeb737cb42f914451b94b151fec5ab0c0729b096bb
parentbcc1dee60019f3a488a04dc7f701f7a692040fed
[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
13 files changed:
llvm/docs/LangRef.rst
llvm/include/llvm/IR/DerivedTypes.h
llvm/lib/CodeGen/Analysis.cpp
llvm/lib/IR/DataLayout.cpp
llvm/lib/IR/Type.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/CodeGen/RISCV/scalable-vector-struct.ll [new file with mode: 0644]
llvm/test/Other/scalable-vector-struct-intrinsic.ll [new file with mode: 0644]
llvm/test/Other/scalable-vector-struct.ll [deleted file]
llvm/test/Verifier/scalable-global-vars.ll
llvm/test/Verifier/scalable-vector-struct-alloca.ll [new file with mode: 0644]
llvm/test/Verifier/scalable-vector-struct-load.ll [new file with mode: 0644]
llvm/test/Verifier/scalable-vector-struct-store.ll [new file with mode: 0644]