[PATCH] D31960: [InstSimplify] fold identity shuffles (recursing if needed)

Andrea Di Biagio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 06:30:12 PDT 2017


andreadb accepted this revision.
andreadb added a comment.
This revision is now accepted and ready to land.

I only have one request. Otherwise it LGTM too.



================
Comment at: lib/Analysis/InstructionSimplify.cpp:4188-4191
+  for (unsigned i = 0; i != MaskNumElts; ++i) {
+    // Note that recursion is limited for each vector element, so if any element
+    // exceeds the limit, this will fail to simplify.
+    RootVec = foldIdentityShuffles(i, Op0, Op1, Mask, RootVec, i, MaxRecurse);
----------------
You can skip this loop if you know in advance that at least one index in Mask is undef.
Otherwise, you would end up with needless recursive calls to foldIdentityShuffles().


https://reviews.llvm.org/D31960





More information about the llvm-commits mailing list