[DAG] Improved target independent vector shuffle folding logic.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Sat, 15 Nov 2014 22:56:25 +0000 (22:56 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Sat, 15 Nov 2014 22:56:25 +0000 (22:56 +0000)
commite13a0b81f416e3e5353e5c72e06db9a9171adc82
treea85eecfe707054a12fd2ab6ffd6f7d5fab113362
parentd1c12e65cd58581a48a2e3ad48a07d202415a638
[DAG] Improved target independent vector shuffle folding logic.

This patch teaches the DAGCombiner how to combine shuffles according to rules:
   shuffle(shuffle(A, Undef, M0), B, M1) -> shuffle(B, A, M2)
   shuffle(shuffle(A, B, M0), B, M1) -> shuffle(B, A, M2)
   shuffle(shuffle(A, B, M0), A, M1) -> shuffle(B, A, M2)

llvm-svn: 222090
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/vector-shuffle-combining.ll