[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
This commit is contained in:
@@ -65,7 +65,8 @@ StructLayout::StructLayout(StructType *ST, const DataLayout &DL) {
|
||||
StructAlignment = std::max(TyAlign, StructAlignment);
|
||||
|
||||
MemberOffsets[i] = StructSize;
|
||||
StructSize += DL.getTypeAllocSize(Ty); // Consume space for this data item
|
||||
// Consume space for this data item
|
||||
StructSize += DL.getTypeAllocSize(Ty).getFixedValue();
|
||||
}
|
||||
|
||||
// Add padding to the end of the struct so that it could be put in an array
|
||||
|
||||
Reference in New Issue
Block a user