This is an archive of the discontinued LLVM Phabricator instance.

Add forgetBlock in PredIteratorCache.
AcceptedPublic

Authored by trentxintong on Mar 11 2017, 10:16 PM.

Details

Reviewers
dberlin
Summary

This is preparatory work to make Jump Threading to use PredIterCache.
There are places in which some of the predecessors are split in Jump Threading.

Event Timeline

trentxintong created this revision.Mar 11 2017, 10:16 PM
dberlin accepted this revision.Mar 12 2017, 9:20 AM

I'm all in favor of cache invalidation when weird things happen, but I also assume you could just tell it when you are removing/adding edges as well?

IE i would expect this kind of invalidation when we do something like "clone a loop", or "clone a region" and it's difficult to tell what happened.

But otherwise, i presume we could just update it instead of destroy it.

Anyway, probably not worth it here.
Just sayin.

This revision is now accepted and ready to land.Mar 12 2017, 9:20 AM

Hmmm, actually, i bet, for jump threading, the way it caches preds is slower than counting them repeatedly.
If it just cached the count, that would likely be fast, but i expect the copying is slower than the counting,.

Hmmm, actually, i bet, for jump threading, the way it caches preds is slower than counting them repeatedly.
If it just cached the count, that would likely be fast, but i expect the copying is slower than the counting,.

There are some opportunities for caching the basicblock* list in jump threading (In addtion to the count). But we also need to do the copy ... I will wait for the outcome of your investigation in https://reviews.llvm.org/D30873