This is an archive of the discontinued LLVM Phabricator instance.

Refactor some BasicBlockUtils functions (NFC)
ClosedPublic

Authored by chill on Jun 29 2023, 1:59 AM.

Details

Summary

Add a more "flexible" SplitBlockAndInsertIfThenElse function
and re-implement some others on top of it.

Diff Detail

Event Timeline

chill created this revision.Jun 29 2023, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 1:59 AM
chill requested review of this revision.Jun 29 2023, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 1:59 AM

LGTM along with D154053.

llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
467

containthe -> contain the

473

Maybe remove the comma?

llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
1525

Could this be made into a little lambda for the true and false blocks?

chill updated this revision to Diff 541955.Jul 19 2023, 4:37 AM
chill marked 3 inline comments as done.
dmgreen accepted this revision.Jul 19 2023, 7:19 AM

Thanks LGTM

llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
1526

Encapsulate

1530

do -> Do

This revision is now accepted and ready to land.Jul 19 2023, 7:19 AM
chill updated this revision to Diff 542066.Jul 19 2023, 9:25 AM
chill marked 2 inline comments as done.
This revision was landed with ongoing or failed builds.Jul 19 2023, 10:21 AM
This revision was automatically updated to reflect the committed changes.