[X86] Add a check for 'isMOVHLPSMask' within method 'isShuffleMaskLegal'.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 16 Jul 2014 11:29:39 +0000 (11:29 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 16 Jul 2014 11:29:39 +0000 (11:29 +0000)
commit35f6e97777cd750b438c7d512a9cc635279e1e9f
tree5a859d58dac999705b5ce748296179acd3dee219
parent8fa83afb83ea16e768db8f515658b213a606863e
[X86] Add a check for 'isMOVHLPSMask' within method 'isShuffleMaskLegal'.

Before this change, method 'isShuffleMaskLegal' didn't know that shuffles
implementing a 'movhlps' operation were perfectly legal for SSE targets.

This patch adds the missing check for 'isMOVHLPSMask' inside method
'isShuffleMaskLegal' to fix the problem.

The reason why it is important to do this is because the DAGCombiner
conservatively avoids combining a pair of shuffles if the resulting shuffle
node has an illegal mask. Before this patch, shuffles with a MOVHLPS mask were
wrongly considered not to be legal. This was the root cause of some poor-code
generation bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213137 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/combine-vec-shuffle-3.ll
test/CodeGen/X86/combine-vec-shuffle-4.ll