This handles case :
if (a || b)
return;
// Large_body of slow path code
do_something here.
Differential D32249
[PartialInl] Enhance partial inliner to handle more complex conditions davidxl on Apr 19 2017, 3:07 PM. Authored by
Details This handles case : if (a || b) return; // Large_body of slow path code
Diff Detail
Event TimelineComment Actions I've a couple of trivial comments so far. Could you please generate a diff with a larger context?
Comment Actions I am thinking of another two issues:
Sorry I didn't come up with them at the first beginning and dive into details. Comment Actions
Yes, i was thinking adding a limit on the chain length as an option. Probably do this a a follow up -- which also needs to look at profile data. (Note that Partialinlininer is currently not enabled in any optimization pipeline yet).
a&b&c case is already partially handled -- the partial inliner can partially peel the first iteration which may be good enough. However I do like your suggestion of computing the entry predicate region idea. Comment Actions
I think instruction count will be better limit than chain length.
Comment Actions Address review feedback. The new version now can handle more general conditions (see test cases).
Comment Actions Some minor comments.
Comment Actions LGTM. Please add a comment to explain the condition for exiting the loop for exceeding MaxNumInlineBlocks.
|
@davidxl Please correct me if I'm wrong, but in this loop, if the first instruction in the BB is not a PHINode we give up? If that's the case, then wouldn't 'Phi' be the first and only Phi we'll find?