This is an archive of the discontinued LLVM Phabricator instance.

[MachineRegisterInfo] Avoid having dbg.values affect code generation
ClosedPublic

Authored by uabelho on Oct 18 2017, 4:18 AM.

Details

Summary

Use use_nodbg_empty() rather than use_empty() in
MachineRegisterInfo::EmitLiveInCopies() when determining if a livein
register has any uses or not. Otherwise a single dbg.value can make us
generate different code, meaning -g would affect code generation.

Found when compiling code for my out-of-tree target. Unfortunately I
haven't been able to reproduce the problem on X86 or any of the other
in-tree targets that I tried, so no test case.

Diff Detail

Event Timeline

uabelho created this revision.Oct 18 2017, 4:18 AM

Not sure who should review this. Added Matthias who seems to have reviewed other patches in MRI.

Does this make sense even without a test case?

When I've tried to reproduce on X86 there always seems to be another COPY making use_empty() return
false, or the dbg.value has been dropped for some reason during ISel.

MatzeB accepted this revision.Nov 15 2017, 9:43 AM

LGTM, thanks.

This revision is now accepted and ready to land.Nov 15 2017, 9:43 AM
This revision was automatically updated to reflect the committed changes.