This is an archive of the discontinued LLVM Phabricator instance.

[IR] Adds Function::splice() member functions.
ClosedPublic

Authored by vporpo on Dec 13 2022, 5:21 PM.

Details

Summary

This is part of a series of patches that aim at making Function::getBasicBlockList() private.

Diff Detail

Event Timeline

vporpo created this revision.Dec 13 2022, 5:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 5:21 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vporpo requested review of this revision.Dec 13 2022, 5:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 5:21 PM
vporpo updated this revision to Diff 482690.Dec 13 2022, 7:20 PM

Removed the splice() variant that inserts a single block.
It has the same functionality as Function::insertBasicBlockAt().

aeubanks accepted this revision.Dec 14 2022, 9:13 AM

going to assume this is basically the same as the instruction splicing patch and not look at it too closely :)

This revision is now accepted and ready to land.Dec 14 2022, 9:13 AM

yes it is very similar

This revision was landed with ongoing or failed builds.Dec 14 2022, 10:47 AM
This revision was automatically updated to reflect the committed changes.
RKSimon added inline comments.
llvm/lib/IR/Function.cpp
378

@vporpo This is breaking on EXPENSIVE_CHECKS builds - FromBBEnd -> FromFEnd ?

vporpo added inline comments.Dec 14 2022, 11:10 AM
llvm/lib/IR/Function.cpp
378

Ooops let me fix it forward. Thanks!

vporpo added inline comments.Dec 14 2022, 11:27 AM
llvm/lib/IR/Function.cpp
378

Thanks - I'm also seeing a few unused variable warnings

llvm/unittests/IR/FunctionTest.cpp
442

I'm also seeing these build warnings:

E:\llvm\llvm-project\llvm\unittests\IR\FunctionTest.cpp(442): warning C4189: 'ToBB3': local variable is initialized but not referenced
E:\llvm\llvm-project\llvm\unittests\IR\FunctionTest.cpp(440): warning C4189: 'ToBB1': local variable is initialized but not referenced
E:\llvm\llvm-project\llvm\unittests\IR\FunctionTest.cpp(437): warning C4189: 'FromBB3': local variable is initialized but not referenced
vporpo added inline comments.Dec 14 2022, 12:09 PM
llvm/unittests/IR/FunctionTest.cpp
442

Just pushed the patch for these too 9eb5d9cbe9e53d16dbedf922259ae3643d919603. Thanks!