[PATCH] D30631: [BPI] Use metadata info before any other heuristics

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 5 22:57:59 PST 2017


skatkov added a comment.

Hi Vedant, 
I picked your name as one who touched this code.

Thank you, for the review and good point about the testcase. I will update it after gathring a bit more of review.

As I've undersood PostDominatedByUnreachable is computed inside calcUnreachableHeuristics, if on the path there will be some metadata available for some block which dominates unreachable block we will handle it in calcMetadataWeights and this block will not be added to PostDominatedByUnreachable. So the predecessor of this block will not consider it as dominating unreachable block. So the analysis will not be complete. So the trouble happens if metadata is present but not for each branch.

To resolve it we can run calcUnreachableHeuristics, rememeber the result and force running calcMetadataWeights to overwrite our heuristics. After calcMetadataWeights we can re-check the result of calcUnreachableHeuristics and bailout if any of previous ones handled block.
It is not clean from code but it works.


https://reviews.llvm.org/D30631





More information about the llvm-commits mailing list