[PATCH] D96854: [CodeExtractor] Enable partial aggregate arguments
Giorgis Georgakoudis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 30 07:07:54 PDT 2021
ggeorgakoudis added a comment.
In D96854#2645458 <https://reviews.llvm.org/D96854#2645458>, @vsk wrote:
> Thanks for explaining. I'd suggest making ExcludedAggArgs part of a CodeExtractor instances internal state: e.g. the client may call CE.addArgExludedFromAggregate(Value *) some number of times before CE.extractCodeRegion(). This way, the client doesn't need to maintain a SetVector, and the rest of the interface isn't polluted with an option that's specific to the AggregateArg case.
Hi @vsk, thank you for your feedback. I think the proposed interface is more flexible and easier to support than making exclusions internal to CodeExtractor and having repeated calls through addArgExludedFromAggregate to set them. My line of thinking is that (1) it is more flexible to let the client manage the state and request extraction through extractCodeRegion with it, for example it makes possible to extract the same region with different exclusions without creating another CodeExtractor instance, (2) there is only one, backwards behavior compatible change to the external interface of CodeExtractor, that is for extractCodeRegion, so changes in other methods (constructFunction, emitCallAndSwitchStatement) are internal and changes do not pollute this external API. Please let me know what you think.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96854/new/
https://reviews.llvm.org/D96854
More information about the llvm-commits
mailing list