[PATCH] D40873: [PGO] handle infinite loop properly in pgo instrumention

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 11:32:43 PST 2017


vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D40873#946971, @davidxl wrote:

> What happens is that the call of getAnalysis<LoopInfoWrapperPass>() is invoked after getAnalysis<BlockFrequencyInfoWrapperPass>().  The legacy pass manager in this case will do the analysis run to compute LoopInfo on the fly. Before running the analysis, it will also invoke the 'release' memory method of the analysis passes contained in, in this case is BPI and BFI.    After that we basically have use-after free problem. The leaking is probably just a side effect.


Ah ok, this makes a lot more sense to me as a use-after-free. Thanks, lgtm.


https://reviews.llvm.org/D40873





More information about the llvm-commits mailing list