[PATCH] D101533: [TTI] NFC: Change getTypeLegalizationCost to return InstructionCost.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 08:56:22 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:753
 
-    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
+    const auto LT = TLI->getTypeLegalizationCost(DL, Ty);
 
----------------
AIUI, the LLVM coding standard favours `std::pair<InstructionCost, MVT>` over `auto`, since it's not obvious from the call to `TLI->getTypeLegalizationCost` what the returned type is.

(same for other instances in this file)


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3049
     // This type is legalized to a scalar type.
-    if (!LT.second.isVector())
+    if (!MTy.isVector())
       return 0;
----------------
I would avoid introducing these changes in this patch, as it just adds unnecessarily to the diff 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101533



More information about the llvm-commits mailing list