[llvm] 1ce8a5b - [X86] Only look up boolean reduction cost tables if the reduction is not pairwise.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 26 16:42:27 PDT 2019


Author: Craig Topper
Date: 2019-10-26T16:41:19-07:00
New Revision: 1ce8a5b385a1e2987ecf49080f983615c59f6c73

URL: https://github.com/llvm/llvm-project/commit/1ce8a5b385a1e2987ecf49080f983615c59f6c73
DIFF: https://github.com/llvm/llvm-project/commit/1ce8a5b385a1e2987ecf49080f983615c59f6c73.diff

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

Summary:
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. So this probably has no real
effect today.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69083

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 76d95eda547c..2f899b3947b8 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -2665,7 +2665,7 @@ int X86TTIImpl::getArithmeticReductionCost(unsigned Opcode, Type *ValTy,
   };
 
   // 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;


        


More information about the llvm-commits mailing list