[PATCH] D59507: [DAGCombine] Fix a miscompile when reducing BUILD_VECTORs to a shuffle

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 13:14:26 PDT 2019


bogner created this revision.
bogner added reviewers: RKSimon, jbhateja.
Herald added subscribers: llvm-commits, jdoerfert, mcrosier.
Herald added a project: LLVM.

In r311255 we added a case where we split vectors whose elements are
all derived from the same input vector so that we could shuffle it
more efficiently. In doing so, createBuildVecShuffle was taught to
adjust for the fact that all indices would be based off of the first
vector when this happens, but it's possible for the code that checked
that to fire incorrectly if we happen to have a BUILD_VECTOR of
extracts from subvectors and don't hit this new optimization.

Instead of trying to detect if we've split the vector by checking if
we have extracts from the same base vector, we can just pass that
information into createBuildVecShuffle, avoiding the miscompile.


Repository:
  rL LLVM

https://reviews.llvm.org/D59507

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/shuffle-extract-subvector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59507.191157.patch
Type: text/x-patch
Size: 5645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190318/400579ed/attachment.bin>


More information about the llvm-commits mailing list