[PATCH] D89969: [SLP] Consider alternatives for cost of select instructions.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 09:42:04 PDT 2020


dmgreen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3559-3595
+            auto *Select = dyn_cast<SelectInst>(I);
+            if (!Select)
+              return false;
+            auto *Cmp = dyn_cast<CmpInst>(Select->getOperand(0));
+            if (!Cmp)
+              return false;
+
----------------
ABataev wrote:
> Use `match()` functions to match the pattern. Also, what's the criterion for generating intrinsic or vector instruction? Can we rely on it unconditionally and just choose the minimum cost?
There's something called matchSelectPattern that might help quite a bit too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89969/new/

https://reviews.llvm.org/D89969



More information about the llvm-commits mailing list