[PATCH] D115195: [mlgo][regalloc] Add score calculation for training

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 14:16:24 PDT 2022


MatzeB added a comment.
Herald added a project: All.

I know this review comes pretty late, but FWIW: It seems unfortunate to me that we now have one code path producing optimization remarks in `RAGreedy::computeStats`, while the separate counting formula here is independent of regalloc algorithm but cannot produce optimization remarks for analysis / comparison with non-ML approaches...



================
Comment at: llvm/lib/CodeGen/RegAllocScore.cpp:32-33
+cl::opt<double> CopyWeight("regalloc-copy-weight", cl::init(0.2), cl::Hidden);
+cl::opt<double> LoadWeight("regalloc-load-weight", cl::init(4.0), cl::Hidden);
+cl::opt<double> StoreWeight("regalloc-store-weight", cl::init(1.0), cl::Hidden);
+cl::opt<double> CheapRematWeight("regalloc-cheap-remat-weight", cl::init(0.2),
----------------
What's the reasoning for loads having weight `4.0` compared to stores being just `1.0`? This feels like way too much emphasis on loads.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115195



More information about the llvm-commits mailing list