[DAGCombiner] Attempt to mask vectors before zero extension instead of after.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 15 Aug 2015 13:27:30 +0000 (13:27 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 15 Aug 2015 13:27:30 +0000 (13:27 +0000)
commit3aac2c627be19617472274bba4066f297ac81b00
treeba45f434c7f4f55b210abe24684c8a3c3d889837
parent0cf84bc9111a2515f1f6517417744340fb24c533
[DAGCombiner] Attempt to mask vectors before zero extension instead of after.

For cases where we TRUNCATE and then ZERO_EXTEND to a larger size (often from vector legalization), see if we can mask the source data and then ZERO_EXTEND (instead of after a ANY_EXTEND). This can help avoid having to generate a larger mask, and possibly applying it to several sub-vectors.

(zext (truncate x)) -> (zext (and(x, m))

Includes a minor patch to SystemZ to better recognise 8/16-bit zero extension patterns from RISBG bit-extraction code.

This is the first of a number of minor patches to help improve the conversion of byte masks to clear mask shuffles.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245160 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
test/CodeGen/AArch64/arm64-aapcs.ll
test/CodeGen/AArch64/arm64-arith.ll
test/CodeGen/AArch64/arm64-vector-ext.ll
test/CodeGen/AArch64/bitfield.ll
test/CodeGen/SystemZ/insert-05.ll
test/CodeGen/X86/avx2-conversions.ll
test/CodeGen/X86/vec_cast2.ll
test/CodeGen/X86/vector-zext.ll