[INSTCOMBINE] Transform reduction(shuffle V, poison, unique_mask) to reduction(V).
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 28 Jun 2021 19:21:19 +0000 (12:21 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Tue, 29 Jun 2021 17:02:38 +0000 (10:02 -0700)
commit129ae515fba022353050e0f313b32595de9e4b39
tree0fecf241d6b6041dd622a06eed91fdf6e92282f8
parent5d933c0b0c741767f2af8218d55581557903a254
[INSTCOMBINE] Transform reduction(shuffle V, poison, unique_mask) to reduction(V).

After SLP + LTO we may have have reduction(shuffle V, poison,
mask). This can be simplified to just reduction(V) if the mask is only
for single vector and just all elements from this vector are permuted,
  without reusing, replacing with undefs and/or other values, etc.

Differential Revision: https://reviews.llvm.org/D105053
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/reduction-shufflevector.ll