HomePhabricator

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

Authored by huihuiz on May 7 2020, 1:03 PM.

Description

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

Summary:
This patch fix the following issues with visitExtractElementInst:

  1. Restrict VectorUtils::findScalarElement to fixed-length vector. For scalable type, the number of elements in shuffle mask is unknown at compile-time.
  2. Fix out-of-range calculation for fixed-length vector.
  3. Skip scalable type when analysis rely on fixed number of elements.
  4. Add unit tests to check functionality of extractelement for scalable type.

Reviewers: sdesmalen, efriedma, spatel, nikic

Reviewed By: efriedma

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

Tags: #llvm

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