[PATCH] D146118: [X86]add assert to confirm not-null ptr in getArithmeticReductionCost

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 23:18:07 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe3b4c1bc528b: [X86]add assert to confirm not-null ptr in getArithmeticReductionCost (authored by XinWang10, committed by xin10.wang <wangxin8 at f90srv19.nh.intel.com>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146118

Files:
  llvm/include/llvm/CodeGen/BasicTTIImpl.h


Index: llvm/include/llvm/CodeGen/BasicTTIImpl.h
===================================================================
--- llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -2334,6 +2334,7 @@
   InstructionCost getArithmeticReductionCost(unsigned Opcode, VectorType *Ty,
                                              std::optional<FastMathFlags> FMF,
                                              TTI::TargetCostKind CostKind) {
+    assert(Ty && "Unknown reduction vector type");
     if (TTI::requiresOrderedReduction(FMF))
       return getOrderedReductionCost(Opcode, Ty, CostKind);
     return getTreeReductionCost(Opcode, Ty, CostKind);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146118.505988.patch
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/04e39746/attachment.bin>


More information about the llvm-commits mailing list