[MLGO] ML Regalloc Eviction Advisor
authorMircea Trofin <mtrofin@google.com>
Wed, 22 Dec 2021 20:46:06 +0000 (12:46 -0800)
committerMircea Trofin <mtrofin@google.com>
Wed, 19 Jan 2022 19:00:32 +0000 (11:00 -0800)
commite67430cca40455d31b95b088a88fa3b16a37ea34
tree3050f9bb60a1e797cadab66eb71598802f8da443
parent7cca13bc3a02163c0b822298fefa6ccb1fe1d06e
[MLGO] ML Regalloc Eviction Advisor

The bulk of the implementation is common between 'release' mode (==AOT-ed
model) and 'development' mode (for training), the main difference is
that in development mode, we may also log features (for training logs),
inject scoring information (currently after the Virtual Register
Rewriter) and then produce the log file.

This patch also introduces the score injection pass, 'Register
Allocation Pass Scoring', which is trivially just logging the score in
development mode.

Differential Revision: https://reviews.llvm.org/D117147
18 files changed:
llvm/CMakeLists.txt
llvm/include/llvm/CodeGen/Passes.h
llvm/include/llvm/InitializePasses.h
llvm/lib/Analysis/models/gen-regalloc-eviction-test-model.py [new file with mode: 0644]
llvm/lib/CodeGen/CMakeLists.txt
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
llvm/lib/CodeGen/RegAllocGreedy.h
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/test/CodeGen/AArch64/O3-pipeline.ll
llvm/test/CodeGen/ARM/O3-pipeline.ll
llvm/test/CodeGen/MLRegalloc/Inputs/input.ll [new file with mode: 0644]
llvm/test/CodeGen/MLRegalloc/dev-mode-log-2-fcts.ll [new file with mode: 0644]
llvm/test/CodeGen/MLRegalloc/dev-mode-logging.ll [new file with mode: 0644]
llvm/test/CodeGen/MLRegalloc/dev-rel-equivalence.ll [new file with mode: 0644]
llvm/test/CodeGen/MLRegalloc/rel-codepath.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/O3-pipeline.ll
llvm/test/CodeGen/X86/opt-pipeline.ll