[llvm] e771614 - [ARM] Change getScalarizationOverhead overload used in gather costs. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 03:59:20 PST 2021


Author: David Green
Date: 2021-02-11T11:58:55Z
New Revision: e771614bae0a05585f720812d5936a0b81dcddf0

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

LOG: [ARM] Change getScalarizationOverhead overload used in gather costs. NFC

This changes which of the getScalarizationOverhead overloads is used in
the gather/scatter cost to use the base variant directly, not relying on
the version using heuristics on the number of args with no args
provided. It should still produce the same costs for scalarized
gathers/scatters.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
index af67839c2d757..de2c0607d2edd 100644
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
@@ -1416,8 +1416,9 @@ unsigned ARMTTIImpl::getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
   unsigned VectorCost = NumElems * LT.first * ST->getMVEVectorCostFactor();
   // The scalarization cost should be a lot higher. We use the number of vector
   // elements plus the scalarization overhead.
-  unsigned ScalarCost =
-      NumElems * LT.first + BaseT::getScalarizationOverhead(VTy, {});
+  unsigned ScalarCost = NumElems * LT.first +
+                        BaseT::getScalarizationOverhead(VTy, true, false) +
+                        BaseT::getScalarizationOverhead(VTy, false, true);
 
   if (EltSize < 8 || Alignment < EltSize / 8)
     return ScalarCost;


        


More information about the llvm-commits mailing list