Reorder shuffle and binary operation.
authorSerge Pavlov <sepavloff@gmail.com>
Sun, 11 May 2014 08:46:12 +0000 (08:46 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Sun, 11 May 2014 08:46:12 +0000 (08:46 +0000)
commit86118b4532f0790fe7168fcf00e61a09fa2e5362
tree246c01308e3e871a15cf1821ef239a5256faad67
parent4ccf0ebb19ffcd22ee730d3c90112dea31d619f4
Reorder shuffle and binary operation.

This patch enables transformations:

    BinOp(shuffle(v1), shuffle(v2)) -> shuffle(BinOp(v1, v2))
    BinOp(shuffle(v1), const1) -> shuffle(BinOp, const2)

They allow to eliminate extra shuffles in some cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208488 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineAddSub.cpp
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
lib/Transforms/InstCombine/InstCombineShifts.cpp
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/vec_shuffle.ll
test/Transforms/LoopVectorize/store-shuffle-bug.ll