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

Sotiris Apostolakis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 21:51:09 PDT 2022


apostolakis added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:451
+      for (auto *ColdII : ColdSlice) {
+        SliceCost +=
+            TTI->getInstructionCost(ColdII, TargetTransformInfo::TCK_Latency);
----------------
davidxl wrote:
> 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.
Yes that would seem a good idea. 
Tested a couple of different ways of adjusting the cost and evaluated perf impact on search workload.
Added the one that showed some positive (although only slight) effect. 


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


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