[all-commits] [llvm/llvm-project] 08c9c1: [InstCombine][SVE] Fix visitInsertElementInst for ...
huihzhang via All-commits
all-commits at lists.llvm.org
Thu May 7 12:45:43 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 08c9c13749aebd03bec55442301442670fa0b72c
https://github.com/llvm/llvm-project/commit/08c9c13749aebd03bec55442301442670fa0b72c
Author: Huihui Zhang <huihuiz at quicinc.com>
Date: 2020-05-07 (Thu, 07 May 2020)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
A llvm/test/Transforms/InstCombine/vscale_insertelement.ll
Log Message:
-----------
[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
More information about the All-commits
mailing list