[PATCH] D54280: [x86] try to form broadcast before widening shuffle elements

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 15:44:24 PST 2018


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon.
Herald added a subscriber: mcrosier.

I noticed that we weren't generating broadcasts as much I thought we would with https://reviews.llvm.org/D54271, and this is part of the problem.

Widening the shuffle elements means adding bitcasts and hiding the relationship between a splatted scalar and the vector. If we can form a broadcast, do that before going through the rest of the shuffle lowering because broadcasts should be cheap and can often be load-folded.


https://reviews.llvm.org/D54280

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/haddsub-undef.ll
  test/CodeGen/X86/insert-into-constant-vector.ll
  test/CodeGen/X86/shuffle-of-splat-multiuses.ll
  test/CodeGen/X86/vector-shuffle-128-v4.ll
  test/CodeGen/X86/vector-shuffle-combining.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54280.173238.patch
Type: text/x-patch
Size: 6402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181108/324c6cc6/attachment.bin>


More information about the llvm-commits mailing list