diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -298,7 +298,8 @@ return *Entry = ArrayType::get(ElementTypes[0], cast(Ty)->getNumElements()); case Type::ScalableVectorTyID: - // FIXME: handle scalable vectors + return *Entry = ScalableVectorType::get(ElementTypes[0], + cast(Ty)->getMinNumElements()); case Type::FixedVectorTyID: return *Entry = FixedVectorType::get( ElementTypes[0], cast(Ty)->getNumElements()); diff --git a/llvm/test/Linker/fixed-vector-type-construction.ll b/llvm/test/Linker/fixed-vector-type-construction.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Linker/fixed-vector-type-construction.ll @@ -0,0 +1,5 @@ +; RUN: true +%t = type {i32, float} +define void @foo(<4 x %t*> %x) { + ret void +} \ No newline at end of file diff --git a/llvm/test/Linker/sve-type-construction.ll b/llvm/test/Linker/sve-type-construction.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Linker/sve-type-construction.ll @@ -0,0 +1,7 @@ +; RUN: llvm-link %p/fixed-vector-type-construction.ll %p/sve-type-construction.ll -S -o - | FileCheck %s +%t = type {i32, float} +; CHECK: define void @foo(<4 x +; CHECK; define void @bar( %x) { + ret void +}