[PATCH] D126440: [RISCV] Return an invalid cost for memory ops with unsupported types

LiqinWeng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 20:10:37 PDT 2022


Miss_Grape updated this revision to Diff 432179.

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

https://reviews.llvm.org/D126440

Files:
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp


Index: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -195,7 +195,11 @@
     return BaseT::getMaskedMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
                                         CostKind);
 
-  return getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, CostKind);
+  auto LT = TLI->getTypeLegalizationCost(DL, Src);
+  if (!LT.first.isValid())
+    return InstructionCost::getInvalid();
+
+  return LT.first;
 }
 
 InstructionCost RISCVTTIImpl::getGatherScatterOpCost(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126440.432179.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220526/96f51792/attachment.bin>


More information about the llvm-commits mailing list