[PATCH] D106351: [CostModel] Templatize EntryCost::Cost to allow custom cost metrics

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 04:49:22 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/CostTable.h:48-53
+CostTableLookup(const llvm::CostTblEntryT<CostType> (&Table)[N], int ISD,
+                MVT Ty) {
+  // Wrapper to fix template argument deduction failures.
+  return CostTableLookup<CostType>(
+      llvm::ArrayRef<llvm::CostTblEntryT<CostType>>(Table), ISD, Ty);
+}
----------------
Drop `llvm::`?


================
Comment at: llvm/include/llvm/CodeGen/CostTable.h:52
+  return CostTableLookup<CostType>(
+      llvm::ArrayRef<llvm::CostTblEntryT<CostType>>(Table), ISD, Ty);
+}
----------------
`makeArrayRef(Table)` instead of `llvm::ArrayRef<llvm::CostTblEntryT<CostType>>(Table)`?


================
Comment at: llvm/include/llvm/CodeGen/CostTable.h:81-90
+template <size_t N, class CostType>
+inline const TypeConversionCostTblEntryT<CostType> *ConvertCostTableLookup(
+    const llvm::TypeConversionCostTblEntryT<CostType> (&Table)[N], int ISD,
+    MVT Dst, MVT Src) {
+  // Wrapper to fix template argument deduction failures.
+  return ConvertCostTableLookup<CostType>(
+      llvm::ArrayRef<TypeConversionCostTblEntryT<CostType>>(Table), ISD, Dst,
----------------
Drop `llvm::`?


================
Comment at: llvm/include/llvm/CodeGen/CostTable.h:87
+  return ConvertCostTableLookup<CostType>(
+      llvm::ArrayRef<TypeConversionCostTblEntryT<CostType>>(Table), ISD, Dst,
+      Src);
----------------
`makeArrayRef(Table)`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106351



More information about the llvm-commits mailing list