[PATCH] D120232: [SelectOpti][4/5] Loop Heuristics

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 30 22:05:22 PDT 2022


davidxl added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:466
+  //     to its predicated version. The cost is in terms of latency and the cost
+  //     of a select group is the cost of its most expensive select instruction
+  //     (assuming infinite resources and thus fully leveraging available ILP).
----------------
The second heuristic is similar to the first one -- they are related to latency. Does it make more sense to consider the total pressure on resources?

Also it will be helpful to document in which function herusitc i and ii) are implemented.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:672
+
+  Scaled64 Diff[2] = {LoopCost[0].PredCost - LoopCost[0].NonPredCost,
+                      LoopCost[1].PredCost - LoopCost[1].NonPredCost};
----------------
Perhaps name Diff to Gain to indicate it is the gain from converting Pred to NonPred.


================
Comment at: llvm/test/CodeGen/X86/select-optimize.ll:215
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Test loop heuristic: loop-level critical-path analysis
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
----------------
Add more test cases to cover other heuristics like gradiant


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120232



More information about the llvm-commits mailing list