This is an archive of the discontinued LLVM Phabricator instance.

[loop-deletion] Overly defensive with undef-ing dbg.values.
ClosedPublic

Authored by CarlosAlbertoEnciso on Jun 22 2023, 5:48 AM.

Details

Summary

Explicitly inserting undef is overly defensive. Any values computed
inside the loop that are referenced by dbg.values should naturally
become undef when the loop is deleted, and all other values that
are loop invariant must be preserved.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2023, 5:48 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
CarlosAlbertoEnciso requested review of this revision.Jun 22 2023, 5:48 AM
scott.linder accepted this revision.Jun 28 2023, 3:07 PM
scott.linder added a subscriber: scott.linder.

LGTM

I am not particularly familiar with LoopDeletion, but if the premise from the comment holds (i.e. only debug intrinsics defined in terms of loop invariants will survive) then this sounds like a nice improvement!

This revision is now accepted and ready to land.Jun 28 2023, 3:07 PM

@scott.linder Thanks for your valuable feedback.