This is an archive of the discontinued LLVM Phabricator instance.

[LV] Use BB::instructionsWithoutDebug to skip DbgInfo (NFC).
ClosedPublic

Authored by fhahn on Apr 30 2018, 2:12 AM.

Details

Summary

This patch updates some code responsible the skip debug info to use
BasicBlock::instructionsWithoutDebug. I think this makes things
slightly simpler and more direct.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Apr 30 2018, 2:12 AM
rengolin accepted this revision.Apr 30 2018, 3:29 AM

makes sense. thanks!

This revision is now accepted and ready to land.Apr 30 2018, 3:29 AM
This revision was automatically updated to reflect the committed changes.
mattd added a subscriber: mattd.Apr 30 2018, 7:57 AM

I like this, clean.

Thanks for the cleanup, Florian!

hsaito added a subscriber: hsaito.Apr 30 2018, 11:47 AM

Thanks, Florian. This is loosely related to D46199. See comments there. We need to consciously try using (or even creating) generically reusable code like this, instead of each file having it's own "skip this, skip that".

We need to consciously try using (or even creating) generically reusable code like this, instead of each file having it's own "skip this, skip that".

+1!

fhahn added a comment.Apr 30 2018, 2:37 PM

Thanks, Florian. This is loosely related to D46199. See comments there. We need to consciously try using (or even creating) generically reusable code like this, instead of each file having it's own "skip this, skip that".

That was the intention behind adding BB::instructionsWithoutDebug. It should be applicable to a wide range of cases and I will try to move existing code slowly towards using it. I think there might be a case for having a generic utility function that skips lifetime/assume intrinisics. But at least the few passes I had a look at so far seemed to have problems dealing with those intrinsics in the first place.

davide added a subscriber: davide.May 1 2018, 9:54 AM

LGTM, thanks.