[PATCH] D69083: [X86] Only look up boolean reduction cost tables if the reduction is not pairwise.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 23:35:23 PDT 2019


craig.topper created this revision.
craig.topper added a reviewer: RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

We don't pattern match pairwise shuffles in SelectionDAG. So we
should only return the optimized costs if its not a pairwise
shuffle.

I think SLP vectorizer gives priority to non pairwise shuffle if
the cost is the same. And the look up for reduction intrinsics
passes false for the pairwise flag. I didn't check the loop
vectorizer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69083

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp


Index: llvm/lib/Target/X86/X86TargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -2664,7 +2664,7 @@
   };
 
   // Handle bool allof/anyof patterns.
-  if (ValTy->getVectorElementType()->isIntegerTy(1)) {
+  if (!IsPairwise && ValTy->getVectorElementType()->isIntegerTy(1)) {
     if (ST->hasAVX2())
       if (const auto *Entry = CostTableLookup(AVX2BoolReduction, ISD, MTy))
         return LT.first * Entry->Cost;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69083.225355.patch
Type: text/x-patch
Size: 562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191017/47664e82/attachment.bin>


More information about the llvm-commits mailing list