[PATCH] D110218: [CodeGen][NFC] Add comment to `getCSRFirstUseCost`

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 21 20:15:31 PDT 2021


lkail created this revision.
lkail added reviewers: qcolombet, dexonsmith, manmanren.
Herald added a subscriber: kristof.beyls.
lkail requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

>From usage in `RAGreedy::initializeCSRCost` and `AArch64RegisterInfo::getCSRFirstUseCost`, this value is set assuming `MachineBlockFrequencyInfo::getEntryFreq()` is 1<<14. Add comment to clarify it so that other target can override it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110218

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


Index: llvm/include/llvm/CodeGen/TargetRegisterInfo.h
===================================================================
--- llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+++ llvm/include/llvm/CodeGen/TargetRegisterInfo.h
@@ -875,7 +875,8 @@
 
   /// Allow the target to override the cost of using a callee-saved register for
   /// the first time. Default value of 0 means we will use a callee-saved
-  /// register if it is available.
+  /// register if it is available. This value is set assuming entry block
+  /// frequency is 1<<14.
   virtual unsigned getCSRFirstUseCost() const { return 0; }
 
   /// Returns true if the target requires (and can make use of) the register


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110218.374099.patch
Type: text/x-patch
Size: 682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210922/13d14ab0/attachment.bin>


More information about the llvm-commits mailing list