[PATCH] D15378: [X86] Determine if target shuffle contains zero elements

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 06:43:07 PST 2015


RKSimon created this revision.
RKSimon added reviewers: spatel, andreadb, chandlerc.
RKSimon added a subscriber: llvm-commits.
RKSimon set the repository for this revision to rL LLVM.

getTargetShuffleMask may return shuffle masks with SM_SentinelZero (-2) values (currently just for PSHUFB but VPERM2X128 as well with this patch). Although some calling functions can make use of this (mainly for shuffle combining), others can not and their inclusion makes shuffle mask comparisons more difficult.

This patch adds a flag to getTargetShuffleMask to indicate if the calling function can't handle SM_SentinelZero; getTargetShuffleMask will then return false if it occurs to make handling much easier.

I've tidied up some uses of getTargetShuffleMask to better indicate what is going on - more could be done but at present I don't have test cases to demonstrate it.

Some upcoming patches will make use of this to both support more uses where SM_SentinelZero is not permitted (e.g. combineShuffleToAddSub), and also will allow us to add INSERTPS support to getTargetShuffleMask as part of better zero handling discussed in D14261.

Repository:
  rL LLVM

http://reviews.llvm.org/D15378

Files:
  lib/Target/X86/X86ISelLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15378.42294.patch
Type: text/x-patch
Size: 5133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151209/f3792e9f/attachment.bin>


More information about the llvm-commits mailing list