mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[ConstantFold][SVE] Fix constand fold for vector call.
Summary: Do not iterate on scalable vectors. Reviewers: sdesmalen, efriedma, apazos, huntergr, willlovett Reviewed By: sdesmalen Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74419
This commit is contained in:
parent
886e13050e
commit
10305a8da8
@ -2400,6 +2400,11 @@ static Constant *ConstantFoldVectorCall(StringRef Name,
|
||||
SmallVector<Constant *, 4> Lane(Operands.size());
|
||||
Type *Ty = VTy->getElementType();
|
||||
|
||||
// Do not iterate on scalable vector. The number of elements is unknown at
|
||||
// compile-time.
|
||||
if (VTy->getVectorIsScalable())
|
||||
return nullptr;
|
||||
|
||||
if (IntrinsicID == Intrinsic::masked_load) {
|
||||
auto *SrcPtr = Operands[0];
|
||||
auto *Mask = Operands[2];
|
||||
|
@ -210,3 +210,14 @@ define <vscale x 4 x i32> @select() {
|
||||
%r = select <vscale x 4 x i1> undef, <vscale x 4 x i32> zeroinitializer, <vscale x 4 x i32> undef
|
||||
ret <vscale x 4 x i32> %r
|
||||
}
|
||||
|
||||
declare <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
|
||||
|
||||
define <vscale x 16 x i8> @call() {
|
||||
; CHECK-LABEL: @call(
|
||||
; CHECK-NEXT: [[R:%.*]] = call <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
|
||||
; CHECK-NEXT: ret <vscale x 16 x i8> [[R]]
|
||||
;
|
||||
%r = call <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
|
||||
ret <vscale x 16 x i8> %r
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user