[PATCH] D43618: [X86][MMX] Add support for MMX build vectors (PR29222)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 06:29:37 PST 2018


RKSimon created this revision.
RKSimon added reviewers: craig.topper, spatel.

64-bit MMX vector generation usually ends up lowering into SSE instructions before being spilled/reloaded as a MMX type.

This patch introduces the MMX_BUILD_VECTOR opcode that creates a MMX vector from MMX source values, taking the lowest element from each source.

To support 2/4/8 element versions of the build vector from the same MMX_X86buildvector fragment pattern I had to use multiple levels of complexity so that the longer patterns matched first - I don't know if there is a better way to do this? Alternatively I can create MMX_X86buildvector2, MMX_X86buildvector4 and MMX_X86buildvector8 fragment patterns if that is any better.

https://reviews.llvm.org/D43616 fixes the constant MMX regressions in fast-isel-bc.ll and vector-shuffle-mmx.ll.

We're missing a few consecutive load combines that could be handled in a future patch if that would be useful - my main interest here is avoid SSE usage.


Repository:
  rL LLVM

https://reviews.llvm.org/D43618

Files:
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  lib/Target/X86/X86InstrFragmentsSIMD.td
  lib/Target/X86/X86InstrMMX.td
  test/CodeGen/X86/3dnow-intrinsics.ll
  test/CodeGen/X86/fast-isel-bc.ll
  test/CodeGen/X86/mmx-build-vector.ll
  test/CodeGen/X86/pr29222.ll
  test/CodeGen/X86/vec_insert-mmx.ll
  test/CodeGen/X86/vector-shuffle-mmx.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43618.135410.patch
Type: text/x-patch
Size: 115044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180222/cb4313ed/attachment-0001.bin>


More information about the llvm-commits mailing list