Commit Graph

9 Commits

Author SHA1 Message Date
Mircea Trofin 87ec22de70 [mlgo] More wildcarding in extra features logging for regalloc
May need a different testing approach for opcodes.
2022-10-25 08:20:55 -07:00
Mircea Trofin 8764f461d9 [mlgo] Make regalloc extra features logging test more robust
One of the first few instructions being probed has an opcode that's more
likely to change with work on X86 target, so just regexp-ing it.
2022-10-21 18:49:29 -07:00
Mircea Trofin 0bde5e4bec [mlgo] Fix test post-D136040
Instruction opcodes bumped, trivial fix.
2022-10-20 08:21:19 -07:00
Mircea Trofin bb7b0a2dab [mlgo] Fix one test post-D135934
The test was checking output opcodes, one changed as result of D135934.
2022-10-19 13:49:14 -07:00
Mircea Trofin 280ed30b64 Revert "[mlgo] Fix tests post D133902"
This reverts commit 25d65b5455.

There's a more thorough fix in f9317bf0be
2022-09-30 17:30:08 -07:00
Mircea Trofin 25d65b5455 [mlgo] Fix tests post D133902
The breaks were expected, except for the dev-mode-extra-features-logging
one. XFAIL-ing to unblock bots, investigating further.
2022-09-30 17:27:54 -07:00
Matthias Braun f9317bf0be Fix tied operands in phi-coalescing.mir test; try to adapt MLRegalloc tests
Fix a test using invalid MLIR using different VRegs for the tied operands
of ADD64rr, which happened to trigger an assertion after my latest
changes.

Also attempting to adjust the MLRegalloc tests to the adjusted regalloc
(though I don't have a 100% working setup for them even without my
changes)
2022-09-30 17:20:35 -07:00
Aiden Grossman 8d77f8fde7 [MLGO] Add per-instruction MBB frequencies to regalloc dev features
This commit adds in two new features to the ML regalloc eviction
analysis that can be used in ML models, a vector of MBB frequencies and
a vector of indicies mapping instructions to their corresponding basic
blocks. This will allow for further experimentation with per-instruction
features and give a lot more flexibility for future experimentation over
how we're extracting MBB frequency data currently.

Reviewed By: mtrofin, jacobhegna

Differential Revision: https://reviews.llvm.org/D134166
2022-09-28 18:45:04 +00:00
Aiden Grossman e5e3dccd07 [mlgo] Add in-development instruction based features for regalloc advisor
This patch adds in instruction based features to the regalloc advisor
gated behind a flag so a user can decide at runtime whether or not they
want to enable the feature. The features are only enabled when LLVM is
compiled in MLGO develpment mode (LLVM_HAVE_TF_API) is set to true.

To extract the instruction features, I'm taking a list of segments from
each LiveInterval and noting the start and end SlotIndices. This list is then
sorted based on the start SlotIndex and I iterate through each SlotIndex
to grab instructions, making sure to check for overlaps. This results in
a vector of opcodes and binary mapping matrix that maps live ranges to the
opcodes of the instructions within that LR.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D131930
2022-09-17 19:54:45 +00:00