[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 Mar 2019 21:27:11 +0000 (21:27 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 22 Mar 2019 21:27:11 +0000 (21:27 +0000)
commitb68322f9d0f750c5800d7b8b53566236edb42f69
tree8f73cac9bc6c8da6a9efc19ed7c097821346833f
parente6a81b9bec04d3f8d459ef9cd0bcc881bde6c20f
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

llvm-svn: 356814
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp