This is an archive of the discontinued LLVM Phabricator instance.

[Utils] Cleanup similar cases to MergeBlockIntoPredecessor.
ClosedPublic

Authored by asbirlea on Oct 8 2019, 4:13 PM.

Details

Summary

There are two cases where a block is merged into its predecessor and the
MergeBlockIntoPredecessor API is not used. Update the API so it can be
reused in the other cases, in order to avoid code duplication.

Cleanup motivated by D68659.

Diff Detail

Event Timeline

asbirlea created this revision.Oct 8 2019, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2019, 4:13 PM
asbirlea updated this revision to Diff 225075.Oct 15 2019, 10:43 AM

Nit: rename optional argument.
I'd like to check this in, in an effort to clear my patch queue. Please let me know if you have any comments.

I don't immediately see any issues with this patch, but it's outside of my area of expertise, so I'll defer to the other reviewers :)

lib/Transforms/Scalar/LoopUnswitch.cpp
1630 ↗(On Diff #225075)

tiny nit: I/E are more consistent with nearby code

asbirlea updated this revision to Diff 225092.Oct 15 2019, 11:42 AM

Update iterator var names.

asbirlea marked an inline comment as done.Oct 15 2019, 11:42 AM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 16 2019, 3:26 PM
This revision was automatically updated to reflect the committed changes.