HomePhabricator

[InstCombine][SVE] Fix visitInsertElementInst for scalable type.

Authored by huihuiz on May 7 2020, 12:43 PM.

Description

[InstCombine][SVE] Fix visitInsertElementInst for scalable type.

Summary:
This patch fixes the following issues in visitInsertElementInst:

  1. Bail out for scalable type when analysis requires fixed size number of vector elements.
  2. Use cast<FixedVectorType> to get vector number of elements. This ensure assertion on scalable vector type.
  3. For scalable type, avoid folding a chain of insertelement into splat: insertelt(insertelt(insertelt(insertelt X, %k, 0), %k, 1), %k, 2) ... -> shufflevector(insertelt(X, %k, 0), undef, zero) The length of scalable vector is unknown at compile-time, therefore we don't know if given insertelement sequence is valid for splat.

Reviewers: sdesmalen, efriedma, spatel, nikic

Reviewed By: sdesmalen, efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78895

Details

Committed
huihuizMay 7 2020, 12:44 PM
Reviewer
sdesmalen
Differential Revision
D78895: [InstCombine][SVE] Fix visitInsertElementInst for scalable type.
Parents
rG5eae715a3115: [mlir] Add NamedAttrList
Branches
Unknown
Tags
Unknown