[PATCH] D86460: [InstCombine] improve demanded element analysis for insert-of-extract

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 07:22:16 PDT 2020


spatel created this revision.
spatel added reviewers: aqjune, lebedev.ri, RKSimon, efriedma.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.
spatel requested review of this revision.

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.


https://reviews.llvm.org/D86460

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86460.287380.patch
Type: text/x-patch
Size: 9790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/ab3b3d36/attachment.bin>


More information about the llvm-commits mailing list