This is an archive of the discontinued LLVM Phabricator instance.

InstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.
ClosedPublic

Authored by zvi on Apr 22 2017, 12:18 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon accepted this revision.Apr 22 2017, 5:06 AM

LGTM with one minor

lib/Analysis/InstructionSimplify.cpp
4155 ↗(On Diff #96274)

Might be overkill but maybe add assert for MaskNumElts == Indices.size() ?

This revision is now accepted and ready to land.Apr 22 2017, 5:06 AM
spatel added a subscriber: spatel.Apr 24 2017, 8:58 AM
spatel added inline comments.
lib/Analysis/InstructionSimplify.cpp
4189 ↗(On Diff #96274)

I think you can use the LLVM version of find() here to reduce C++ ugliness:

if (find(Indices, -1) != Indices.end())
zvi updated this revision to Diff 96633.Apr 25 2017, 2:26 PM

Address Simon and Sanjay's comments.

zvi marked 2 inline comments as done.Apr 25 2017, 2:26 PM
spatel accepted this revision.Apr 25 2017, 2:41 PM

LGTM.

This revision was automatically updated to reflect the committed changes.