[InstCombine] don't propagate wider shufflevector arguments to predecessors
authorSanjay Patel <spatel@rotateright.com>
Fri, 28 Sep 2018 15:24:41 +0000 (15:24 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 28 Sep 2018 15:24:41 +0000 (15:24 +0000)
commit242f90fe82ef60e7dc4629961f7c732ccf5e69f8
tree232e044dea1487e7896bbd1e3de763cf39125106
parent699ee504f6448516d1fe89f8f56a61584b774a4a
[InstCombine] don't propagate wider shufflevector arguments to predecessors

InstCombine would propagate shufflevector insts that had wider output vectors onto
predecessors, which would sometimes push undef's onto the divisor of a div/rem and
result in bad codegen.

I've fixed this by just banning propagating shufflevector back if the result of
the shufflevector is wider than the input vectors.

Patch by: @sheredom (Neil Henning)

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

llvm-svn: 343329
llvm/include/llvm/IR/Instructions.h
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/vec_shuffle.ll