[PATCH] D38388: [DAGCombiner, x86] convert insertelement of bitcasted vector into shuffle

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 10:59:51 PDT 2017


spatel updated this revision to Diff 117180.
spatel added a comment.
Herald added a subscriber: javed.absar.

Patch updated:

1. Use the existing isShuffleMaskLegal() TLI hook to determine when this transform is possible.
2. To make that query legitimate, perform the shuffle in the type of the padded subvector.
3. To make the proper shuffle op, bitcast the big vector and bitcast the shuffle back to the big vector type.

This gives us the same wins for x86 as the earlier rev only if the vector type is legal. Ie, we no longer optimize the 512-bit vectors for an AVX2 target. That's ok because we don't care about optimizing codegen for oversized illegal vector types?

I think there's also an improvement for AArch64 now that we're using a hook that is enabled for other targets. We had:

  ins	v1.d[1], v0.d[0]
  mov		v0.16b, v1.16b

and now:

  zip1	v0.2d, v1.2d, v0.2d


https://reviews.llvm.org/D38388

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/AArch64/arm64-neon-copy.ll
  test/CodeGen/X86/insertelement-shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38388.117180.patch
Type: text/x-patch
Size: 9547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170929/c40580ae/attachment.bin>


More information about the llvm-commits mailing list