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

Sotiris Apostolakis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 22:27:34 PDT 2022


apostolakis added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:474
+      InstructionCost AdjSliceCost =
+          divideNearest(SliceCost * HotWeight, TotalWeight);
+      if (AdjSliceCost >=
----------------
davidxl wrote:
> Is there a concern on the overflow of the multiplication? Probably not if the meta data weight is 32 bit.
The weight metadata indeed contains 32-bit values and the SliceCost is expected to be small (these cold slices contain a handful of instructions with typical costs of 1 to 4 for each instruction). So, no real concern of overflowing here.


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