[llvm] [BasicTTI] When costing a scalarized cast, use distinct src and dest types (PR #109325)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 19 21:44:16 PDT 2024
================
@@ -1186,8 +1186,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
// Return the cost of multiple scalar invocation plus the cost of
// inserting and extracting the values.
- return getScalarizationOverhead(DstVTy, /*Insert*/ true, /*Extract*/ true,
- CostKind) +
+ return getScalarizationOverhead(SrcVTy, /*Insert*/ false,
+ /*Extract*/ true, CostKind) +
+ getScalarizationOverhead(DstVTy, /*Insert*/ true,
+ /*Extract*/ false, CostKind) +
----------------
arsenm wrote:
It doesn't really make sense to me that this would be an additive cost. For upcasts I'd expect to use the result type, and downcasts the source?
https://github.com/llvm/llvm-project/pull/109325
More information about the llvm-commits
mailing list