[PATCH] D120231: [SelectOpti][3/5] Base Heuristics

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 23:07:05 PDT 2022


davidxl added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:451
+      for (auto *ColdII : ColdSlice) {
+        SliceCost +=
+            TTI->getInstructionCost(ColdII, TargetTransformInfo::TCK_Latency);
----------------
Should the cost also consider the frequency difference between the SI and the cold operand?

basically the colder the operand, the more expensive it is to use CMOV.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:453
+            TTI->getInstructionCost(ColdII, TargetTransformInfo::TCK_Latency);
+        if (SliceCost >= TargetTransformInfo::TCC_Expensive)
+          return true;
----------------
Suggest adding an option which is the multiplier of the TCC_expensive


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120231



More information about the llvm-commits mailing list