[PATCH] D91059: [LoopVectorizer] NFCI: Calculate register usage based on TLI.getTypeLegalizationCost.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 06:38:08 PST 2020
sdesmalen added a comment.
In D91059#2388573 <https://reviews.llvm.org/D91059#2388573>, @uabelho wrote:
> Hi,
>
> I hit an assertion with this patch:
> opt: ../lib/IR/Type.cpp:620: static llvm::FixedVectorType *llvm::FixedVectorType::get(llvm::Type *, unsigned int): Assertion `isValidElementType(ElementType) && "Element type of a VectorType must " "be an integer, floating point, or " "pointer type."' failed.
>
> Reproduce with
> opt -loop-vectorize -mtriple x86_64 -o /dev/null extractvalue-crash.ll
>
> with the input
>
> ; RUN: opt -loop-vectorize -mtriple x86_64 -o /dev/null %s
> %rec6 = type { i16 }
>
> ; Don't crash on trying to vectorize an extractvalue.
>
> @b = global %rec6 zeroinitializer
>
> define void @f1() {
> %_tmp2 = icmp ne i16 0, 0
> br i1 %_tmp2, label %bb1.preheader, label %bb3
>
> bb1.preheader: ; preds = %0
> %_tmp4 = load %rec6, %rec6* @b
> br label %bb1
>
> bb1: ; preds = %bb1.preheader, %bb1
> %_tmp81 = phi i16 [ 0, %bb1.preheader ], [ %_tmp7, %bb1 ]
> %_tmp4.fca.0.extract = extractvalue %rec6 %_tmp4, 0
> %_tmp7 = sub i16 %_tmp81, 1
> %_tmp9 = icmp ne i16 %_tmp7, 0
> br i1 %_tmp9, label %bb1, label %bb3.loopexit
>
> bb3.loopexit: ; preds = %bb1
> %_tmp7.lcssa = phi i16 [ %_tmp7, %bb1 ]
> br label %bb3
>
> bb3: ; preds = %bb3.loopexit, %0
> ret void
> }
Thanks for reporting @uabelho, I'll revert the patch for now and fix the issue!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91059/new/
https://reviews.llvm.org/D91059
More information about the llvm-commits
mailing list