This is an archive of the discontinued LLVM Phabricator instance.

[StackColoring] Fix a debug invariance problem
ClosedPublic

Authored by bjope on Sep 14 2021, 6:29 AM.

Details

Summary

Ignore dbg instructions when collecting stack slot markers. This is
to make sure the coloring is invariant regarding presence of dbg
instructions (even in cases when the dbg instructions might be
badly placed in the input).

Diff Detail

Event Timeline

bjope created this revision.Sep 14 2021, 6:29 AM
bjope requested review of this revision.Sep 14 2021, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2021, 6:29 AM

This looks reasonable to me.

llvm/lib/CodeGen/StackColoring.cpp
717

an early continue at the begging of the loop as:

if (MI.isDebugInstr())
  continue;

?

bjope added inline comments.
llvm/lib/CodeGen/StackColoring.cpp
717

Thanks for taking a look (I haven't figured out whom to add as a reviewer yet, but maybe you are signing up as a volounteer)!

And sure, probably cleaner to add such an early continue to show that we ignore debug instructions throughout the analysis. I'll fix that.

bjope updated this revision to Diff 372475.Sep 14 2021, 7:02 AM

Move the check for isDebugInstr() to beginning of the loop.

bjope marked an inline comment as done.Sep 14 2021, 7:03 AM
djtodoro accepted this revision.Sep 14 2021, 7:12 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 14 2021, 7:12 AM
This revision was landed with ongoing or failed builds.Sep 14 2021, 10:25 AM
This revision was automatically updated to reflect the committed changes.