This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Find source of the inserted element of INSERTPS
ClosedPublic

Authored by RKSimon on Jan 27 2016, 2:53 PM.

Details

Summary

Minor patch to trace back through target shuffles to the source of the inserted element in a (V)INSERTPS shuffle.

Follow up to D16072.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 46181.Jan 27 2016, 2:53 PM
RKSimon retitled this revision from to [X86][SSE] Find source of the inserted element of INSERTPS.
RKSimon updated this object.
RKSimon added reviewers: delena, andreadb, spatel.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
spatel accepted this revision.Jan 31 2016, 9:15 AM
spatel edited edge metadata.

LGTM. One idealistic shuffle mask suggestion. :)

lib/Target/X86/X86ISelLowering.cpp
24023 ↗(On Diff #46181)

I know this is currently inconsistent, but how about adding a helper function that does something like:

bool isZeroOrUndefMaskElt(int Elt) {
  if (Elt == SM_SentinelUndef || Elt == SM_SentinelZero)
    return true;
  return false;
}
This revision is now accepted and ready to land.Jan 31 2016, 9:15 AM
This revision was automatically updated to reflect the committed changes.

Thanks Sanjay. I've added the isUndefOrZero helepr function - which can be used with target shuffle combines (but not lowering).