Reland "[mlgo] Hook up the interactive runner to the mlgo-ed passes"
authorMircea Trofin <mtrofin@google.com>
Sat, 4 Feb 2023 01:03:11 +0000 (17:03 -0800)
committerMircea Trofin <mtrofin@google.com>
Sat, 4 Feb 2023 01:54:42 +0000 (17:54 -0800)
commit5fd51fcba6a5d675e60a59b4ed6c449efe70f41b
tree9f34c7edcc2f0192e15edb761dd26d4084e2bb36
parent51fa03200f7e7e456ccd9b62d522d29429b2d4e6
Reland "[mlgo] Hook up the interactive runner to the mlgo-ed passes"

This reverts commit a772f0bb920a4957fb94dd8dbe45943809fd0ec3.

The main problem was related to how we handled `dbgs()` from the hosted
compiler. Using explicit `subprocess.communicate`, and not relying on
dbgs() being flushed until the end appears to address the problem.

Also some fixes due to some bots running older pythons, so we can't have
nice things like `int | float` and such.
16 files changed:
llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
llvm/include/llvm/Analysis/InteractiveModelRunner.h
llvm/include/llvm/Analysis/MLModelRunner.h
llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/MLInlineAdvisor.cpp
llvm/lib/Analysis/models/interactive_host.py [new file with mode: 0644]
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
llvm/lib/CodeGen/MLRegallocPriorityAdvisor.cpp
llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp
llvm/test/CodeGen/MLRegalloc/Inputs/interactive_main.py [new file with mode: 0644]
llvm/test/CodeGen/MLRegalloc/interactive-mode.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/ML/Inputs/interactive_main.py [new file with mode: 0644]
llvm/test/Transforms/Inline/ML/interactive-mode.ll [new file with mode: 0644]