[PATCH] D134166: [MLGO] Add per-instruction MBB frequencies to regalloc dev features

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 09:55:25 PDT 2022


mtrofin added inline comments.


================
Comment at: llvm/unittests/CodeGen/MLRegallocDevelopmentFeatures.cpp:249
+      [FirstIndex](SlotIndex InputSlot) -> MachineBasicBlock * {
+        // Use dummy pointer values here as the pointers are only used for
+        // indexing between different MBBs rather than to actually access any
----------------
Try rather making real MBB objects instead - the problem is that, if later we start dereferencing the MBB, this test will probably fail, and probably with non-deterministic failures - because the addressed memory will be invalid.

Should be like a 2-liner, make a Function, a MachineFunction, and create MBBs. I think some unittests have examples.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134166



More information about the llvm-commits mailing list