This is an archive of the discontinued LLVM Phabricator instance.

a better fix for llvm-reduce's basicblock pass
ClosedPublic

Authored by regehr on Aug 3 2022, 5:36 PM.

Details

Summary

the fix I submitted yesterday fixed all cases I had seen but missed other cases, that are now fixed by this patch. I'm fairly sure this is now solid.

Diff Detail

Event Timeline

regehr created this revision.Aug 3 2022, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 5:36 PM
regehr requested review of this revision.Aug 3 2022, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 5:36 PM
regehr added a comment.Aug 3 2022, 5:37 PM

this is the first version of llvm-reduce I've seen that makes it all the way through my benchmark suite in --abort-on-invalid-reduction mode!

arsenm added inline comments.Aug 3 2022, 6:12 PM
llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
112

This is just continue

124–125

; after :

138

When doing the MIR version I found it was easier to only track the deletion set. Does this really need a set for both?

regehr added inline comments.Aug 3 2022, 6:22 PM
llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
112

yeah I was going for consistency with the goto in the following code (which isn't just continue) but can do continue if you think that's cleaner

124–125

the semicolon is required. if this is all too ugly I can use a boolean flag instead of the gotos. I wrote them both and thought this way is a bit cleaner but happy to do the other thing

138

well, the existing code uses both, and I'm trying to be minimally invasive. if we want to refactor to get rid of one of them, I think we should do it as a separate patchset

arsenm added inline comments.Aug 4 2022, 7:39 AM
llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
113

BBSToDelete.count?

regehr updated this revision to Diff 449990.Aug 4 2022, 8:30 AM

updated patch with code suggested by matt, thanks, this is much better

regehr marked an inline comment as done.Aug 4 2022, 8:30 AM
arsenm accepted this revision.Aug 4 2022, 8:51 AM

LGTM

This revision is now accepted and ready to land.Aug 4 2022, 8:51 AM
regehr updated this revision to Diff 450002.Aug 4 2022, 8:55 AM

better now

regehr updated this revision to Diff 450005.Aug 4 2022, 8:57 AM

ok hopefully final version, sorry, getting started slowly this morning

arsenm accepted this revision.Aug 4 2022, 8:59 AM
This revision was landed with ongoing or failed builds.Aug 4 2022, 9:22 AM
This revision was automatically updated to reflect the committed changes.