This is an archive of the discontinued LLVM Phabricator instance.

[CodeExtractor] Allowing for caller to access final inputs and outputs.
ClosedPublic

Authored by AndrewLitteken on Jul 28 2021, 1:00 PM.

Details

Summary

The Code Extractor does not provide an easy mechanism for determining the inputs and outputs after extraction has occurred, this patch gives the ability to pass in empty SetVectors to be filled with the inputs and outputs if they need to be analyzed.

Diff Detail

Unit TestsFailed

Event Timeline

AndrewLitteken created this revision.Jul 28 2021, 1:00 PM
AndrewLitteken requested review of this revision.Jul 28 2021, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 1:00 PM

Add a testcase to unittests/Transforms/Utils/CodeExtractorTest.cpp?

Adding a test and clang-format issues.

paquette accepted this revision.Aug 24 2021, 12:57 PM

LGTM with documentation nit.

llvm/include/llvm/Transforms/Utils/CodeExtractor.h
142

Can you add documentation for Inputs and Outputs explaining that they are out-params?

This revision is now accepted and ready to land.Aug 24 2021, 12:57 PM
paquette added inline comments.Aug 24 2021, 12:59 PM
llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
118

Can all of these use EXPECT_EQ?

Updating for nits

paquette accepted this revision.Aug 25 2021, 2:33 PM

LGTM with one more nit

llvm/include/llvm/Transforms/Utils/CodeExtractor.h
147

maybe just say "filled with input values to the outlined function"?

even though this is a typedef of SetVector, it's a little confusing when looking at this locally.

(similar nit with Outputs)

This revision was landed with ongoing or failed builds.Aug 26 2021, 9:48 AM
This revision was automatically updated to reflect the committed changes.