This is an archive of the discontinued LLVM Phabricator instance.

[LiveIntervals] Replace handleMoveIntoBundle
ClosedPublic

Authored by critson on Apr 12 2020, 3:01 AM.

Details

Summary

The current handleMoveIntoBundle implementation is unusable,
it attempts to access the slot indexes of bundled instructions.
It also leaves bundled instructions with slot indexes assigned.

Replace handleMoveIntoBundle this with a more explicit
handleMoveIntoNewBundle function which recalculates the live
intervals for all instructions moved into a newly formed bundle,
and removes slot indexes from these instructions.

Diff Detail

Event Timeline

critson created this revision.Apr 12 2020, 3:01 AM
critson updated this revision to Diff 257201.Apr 13 2020, 10:36 PM

Add basic unit tests.

qcolombet accepted this revision.Apr 14 2020, 9:43 AM
qcolombet added inline comments.
llvm/include/llvm/CodeGen/LiveIntervals.h
318

typo: livenewss

319

Maybe use the \pre marker to make it explicit that these are pre-conditions.

This revision is now accepted and ready to land.Apr 14 2020, 9:43 AM

I wonder if it would make sense to test that the SlotIndex is the same as the one of the bundle header after calling the method.

llvm/include/llvm/CodeGen/LiveIntervals.h
318–322

s/livenewss/liveness/

llvm/lib/CodeGen/LiveIntervals.cpp
1485

Should we check that we are called on a bundled instruction?

critson updated this revision to Diff 257968.Apr 15 2020, 11:27 PM

Fix typos in comments.
Add assertion to check BundleStart is a bundle.
Fix clang-tidy warnings.
Will land this version if pre-merge tests pass.

This revision was automatically updated to reflect the committed changes.