[SLP] Fix regression in broadcasts caused by operand reordering patch D59973.
authorDinar Temirbulatov <dtemirbulatov@gmail.com>
Wed, 5 Jun 2019 15:26:28 +0000 (15:26 +0000)
committerDinar Temirbulatov <dtemirbulatov@gmail.com>
Wed, 5 Jun 2019 15:26:28 +0000 (15:26 +0000)
commit15c657d13d6f12ec4f9c77af8c5034caca9ba7d7
treefae1ec56093b37ea1ac5f8d31c3df69cb4fa343c
parentad62a3a2992744dc9e16fcb248841d7e27be3b7e
[SLP] Fix regression in broadcasts caused by operand reordering patch D59973.

This patch fixes a regression caused by the operand reordering refactoring patch https://reviews.llvm.org/D59973 .
The fix changes the strategy to Splat instead of Opcode, if broadcast opportunities are found.
Please see the lit test for some examples.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

llvm-svn: 362613
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/broadcast.ll