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,10 +298,9 @@ return *Entry = ArrayType::get(ElementTypes[0], cast(Ty)->getNumElements()); case Type::ScalableVectorTyID: - // FIXME: handle scalable vectors case Type::FixedVectorTyID: - return *Entry = FixedVectorType::get( - ElementTypes[0], cast(Ty)->getNumElements()); + return *Entry = VectorType::get(ElementTypes[0], + cast(Ty)->getElementCount()); case Type::PointerTyID: return *Entry = PointerType::get(ElementTypes[0], cast(Ty)->getAddressSpace()); diff --git a/llvm/test/Linker/Inputs/fixed-vector-type-construction.ll b/llvm/test/Linker/Inputs/fixed-vector-type-construction.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Linker/Inputs/fixed-vector-type-construction.ll @@ -0,0 +1,4 @@ +%t = type {i32, float} +define void @foo(<4 x %t*> %x) { + ret void +} diff --git a/llvm/test/Linker/scalable-vector-type-construction.ll b/llvm/test/Linker/scalable-vector-type-construction.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Linker/scalable-vector-type-construction.ll @@ -0,0 +1,7 @@ +; RUN: llvm-link %p/Inputs/fixed-vector-type-construction.ll %s -S -o - | FileCheck %s +%t = type {i32, float} +; CHECK: define void @foo(<4 x +; CHECK; define void @bar( %x) { + ret void +}