This is an archive of the discontinued LLVM Phabricator instance.

[Utils] Salvage debug info from dead 'or' instructions
ClosedPublic

Authored by ibadawi on Feb 9 2018, 10:01 AM.

Details

Summary

Extend salvageDebugInfo to preserve the debug info from a dead 'or' with a constant.

Diff Detail

Event Timeline

ibadawi created this revision.Feb 9 2018, 10:01 AM
aprantl added inline comments.Feb 9 2018, 10:05 AM
lib/Transforms/Utils/Local.cpp
1545

That codepath doesn't look like it's tested?

1548

Could any of the other cases be refactored to make use of this new helper, too?

ibadawi added inline comments.Feb 9 2018, 10:43 AM
lib/Transforms/Utils/Local.cpp
1545

This is the original code path, covered by test/Transforms/InstCombine/debuginfo_add.ll.

1548

I considered also extracting the load case below, but it made things a bit messy since it's not a stack value, so I left it alone.

aprantl accepted this revision.Feb 9 2018, 10:48 AM

Right. Thanks!

This revision is now accepted and ready to land.Feb 9 2018, 10:48 AM
davide accepted this revision.Feb 9 2018, 10:49 AM

LGTM if Adrian/Vedant are happy with this.

ibadawi marked 2 inline comments as done.Feb 9 2018, 10:51 AM

Thanks for the review. I don't have commit access, so can one of you commit it for me? Thanks.

vsk accepted this revision.Feb 9 2018, 11:12 AM

Thank you @ibadawi, this looks great. I can take care of committing this for you.

This revision was automatically updated to reflect the committed changes.