[PATCH] D32388: InstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 08:58:16 PDT 2017


spatel added inline comments.


================
Comment at: lib/Analysis/InstructionSimplify.cpp:4189
   // TODO: Should we allow this?
-  for (unsigned i = 0; i != MaskNumElts; ++i)
-    if (ShuffleVectorInst::getMaskValue(Mask, i) == -1)
-      return nullptr;
+  if (std::find(Indices.begin(), Indices.end(), -1) != Indices.end())
+    return nullptr;
----------------
I think you can use the LLVM version of find() here to reduce C++ ugliness:
  if (find(Indices, -1) != Indices.end())



Repository:
  rL LLVM

https://reviews.llvm.org/D32388





More information about the llvm-commits mailing list