mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[llvm-link] fix IRMover returning wrong modified vector type
Modified scalable vector types weren't correctly returned at link-time. The previous behaviour was a FixedVectorType was constructed when expecting a ScalableVectorType. This commit has added a regression test which re-creates the failure as well as a fix. Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D96953
This commit is contained in:
parent
d689ba9142
commit
78595a3c7a
@ -298,10 +298,9 @@ Type *TypeMapTy::get(Type *Ty, SmallPtrSet<StructType *, 8> &Visited) {
|
||||
return *Entry = ArrayType::get(ElementTypes[0],
|
||||
cast<ArrayType>(Ty)->getNumElements());
|
||||
case Type::ScalableVectorTyID:
|
||||
// FIXME: handle scalable vectors
|
||||
case Type::FixedVectorTyID:
|
||||
return *Entry = FixedVectorType::get(
|
||||
ElementTypes[0], cast<FixedVectorType>(Ty)->getNumElements());
|
||||
return *Entry = VectorType::get(ElementTypes[0],
|
||||
cast<VectorType>(Ty)->getElementCount());
|
||||
case Type::PointerTyID:
|
||||
return *Entry = PointerType::get(ElementTypes[0],
|
||||
cast<PointerType>(Ty)->getAddressSpace());
|
||||
|
4
test/Linker/Inputs/fixed-vector-type-construction.ll
Normal file
4
test/Linker/Inputs/fixed-vector-type-construction.ll
Normal file
@ -0,0 +1,4 @@
|
||||
%t = type {i32, float}
|
||||
define void @foo(<4 x %t*> %x) {
|
||||
ret void
|
||||
}
|
7
test/Linker/scalable-vector-type-construction.ll
Normal file
7
test/Linker/scalable-vector-type-construction.ll
Normal file
@ -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(<vscale x 4 x
|
||||
define void @bar(<vscale x 4 x %t*> %x) {
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user