[all-commits] [llvm/llvm-project] c4f0a0: [InstCombine] improve demanded element analysis fo...

RotateRight via All-commits all-commits at lists.llvm.org
Tue Aug 25 08:22:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c4f0a0896f23d83952c3dfad9e1e539246d85cb6
      https://github.com/llvm/llvm-project/commit/c4f0a0896f23d83952c3dfad9e1e539246d85cb6
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
    M llvm/test/Transforms/InstCombine/vec_demanded_elts.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll
    M llvm/test/Transforms/SLPVectorizer/X86/operandorder.ll

  Log Message:
  -----------
  [InstCombine] improve demanded element analysis for vector insert-of-extract (2nd try)

The 1st attempt (rG557b890) was reverted because it caused miscompiles.
That bug is avoided here by changing the order of folds and as verified
in the new tests.

Original commit message:
InstCombine currently has odd rules for folding insert-extract chains to shuffles,
so we miss collapsing seemingly simple cases as shown in the tests here.

But poison makes this not quite as easy as we might have guessed. Alive2 tests to
show the subtle difference (similar to the regression tests):
https://alive2.llvm.org/ce/z/hp4hv3 (this is ok)
https://alive2.llvm.org/ce/z/ehEWaN (poison leakage)

SLP tends to create these patterns (as shown in the SLP tests), and this could
help with solving PR16739.

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




More information about the All-commits mailing list