-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
Description
This is a perhaps over-reduced example that fails with an error:
opt: /root/llvm-project/llvm/lib/Transforms/Vectorize/VPlan.cpp:708: virtual void llvm::VPRegionBlock::execute(llvm::VPTransformState*): Assertion `!State->VF.isScalable() && "VF is assumed to be non scalable."' failed.
https://godbolt.org/z/vdjWqGafr
define linkonce_odr dso_local void @_ZNK1MILi3EdEmlIdEES0_RKT_(ptr noalias align 8 %agg.result, ptr noundef nonnull align 8 dereferenceable(40) %this, ptr noundef nonnull align 8 dereferenceable(8) %a) local_unnamed_addr #0 align 2 {
entry:
%arrayidx.i.le.i = getelementptr inbounds i8, ptr %this, i64 32
%0 = load i64, ptr %arrayidx.i.le.i, align 8
%cmp12 = icmp sgt i64 %0, 0
br i1 %cmp12, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%arrayidx.i18.233.i = getelementptr inbounds i8, ptr %agg.result, i64 32
%1 = load i64, ptr %arrayidx.i18.233.i, align 8
%arrayidx.i18.131.i = getelementptr inbounds i8, ptr %agg.result, i64 24
%2 = load i64, ptr %arrayidx.i18.131.i, align 8
%arrayidx.i18.i = getelementptr inbounds i8, ptr %agg.result, i64 16
%3 = load i64, ptr %arrayidx.i18.i, align 8
%mul.1.i = mul i64 %2, %1
%mul.2.i = mul i64 %mul.1.i, %3
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
ret void
for.body: ; preds = %for.body.lr.ph, %for.body
%f.013 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%div.i = udiv i64 %f.013, %mul.2.i
%rem.i = urem i64 %f.013, %mul.2.i
%div.1.i = udiv i64 %rem.i, %mul.1.i
%rem.1.i = urem i64 %rem.i, %mul.1.i
%div.2.i = udiv i64 %rem.1.i, %1
%rem.2.i = urem i64 %rem.1.i, %1
%mul.i = mul i64 %3, %div.i
%add.i = add i64 %mul.i, %div.1.i
%mul.1.i9 = mul i64 %add.i, %2
%add.1.i = add i64 %mul.1.i9, %div.2.i
%mul.2.i11 = mul i64 %add.1.i, %1
%add.2.i = add i64 %mul.2.i11, %rem.2.i
%sext.i = shl i64 %add.2.i, 32
%conv6.i = ashr exact i64 %sext.i, 32
%arrayidx.i.i.i = getelementptr inbounds i32, ptr null, i64 %conv6.i
store i32 poison, ptr %arrayidx.i.i.i, align 4
%inc = add nuw nsw i64 %f.013, 1
%exitcond.not = icmp eq i64 %inc, %0
br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body
}
Under LLVM-17 it looks like it will attempt to scalarize the predicated block, only generating the first block of the SVE vector.