This is an archive of the discontinued LLVM Phabricator instance.

[mlgo][regalloc] Factor live interval feature calculation
ClosedPublic

Authored by mtrofin on Jan 31 2022, 2:48 PM.

Details

Summary

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)

Diff Detail

Event Timeline

mtrofin created this revision.Jan 31 2022, 2:48 PM
mtrofin requested review of this revision.Jan 31 2022, 2:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2022, 2:48 PM
mtrofin updated this revision to Diff 404746.Jan 31 2022, 3:05 PM

the start/end freq can stay float, they don't participate in the sums

yundiqian accepted this revision.Jan 31 2022, 3:06 PM
This revision is now accepted and ready to land.Jan 31 2022, 3:06 PM
This revision was landed with ongoing or failed builds.Jan 31 2022, 3:19 PM
This revision was automatically updated to reflect the committed changes.