[DAGCombiner] Add a shuffle mask commutation helper function. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Mar 2015 22:33:11 +0000 (22:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Mar 2015 22:33:11 +0000 (22:33 +0000)
commitb8056be62cf65a2c5f4e83db665f9c300eb57986
treea1a3c4d5be424c684bb358dd29e36fd15064d66b
parentfe1ef279f3457d30ff21d4d474886e7e682ad78d
[DAGCombiner] Add a shuffle mask commutation helper function. NFCI.

We have an increasing number of cases where we are creating commuted shuffle masks - all implementing nearly the same code.

This patch adds a static helper function - ShuffleVectorSDNode::commuteMask() and replaces a number of cases to use it.

Differential Revision: http://reviews.llvm.org/D8139

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231581 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Target/X86/X86ISelLowering.cpp