[all-commits] [llvm/llvm-project] 9aa2c9: [mlgo][regalloc] Factor live interval feature calc...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Mon Jan 31 15:19:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9aa2c914b9710f97a9362c10c08aa11cf2df6ce1
      https://github.com/llvm/llvm-project/commit/9aa2c914b9710f97a9362c10c08aa11cf2df6ce1
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2022-01-31 (Mon, 31 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
    M llvm/test/CodeGen/MLRegalloc/Inputs/reference-log-noml.txt

  Log Message:
  -----------
  [mlgo][regalloc] Factor live interval feature calculation

Factoring it out so we can subsequently cache it. This should be a NFC,
however, for the float quantities, we see small errors in the least
significant digits. This is because, before, we were summing up one by
one. Now, we sum up results of sums.

This shouldn't matter for ML, and will require rework when we do
quantization (avoiding floats altogether), but meanwhile, it did require
an update to the reference file used for testing.

The patch also bumps the precision of the variables involved in this, to
reduce the error (note they are casted back to float at the end by the
SET macro, since we only work with float and not double in TF)

Differential Revision: https://reviews.llvm.org/D118659




More information about the All-commits mailing list