[PATCH] D67612: [UnrolledInstAnalyzer] Use MSSA to find stored values outside of loop.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 16:30:36 PDT 2019


efriedma added a comment.

I think I see the gap in communication here.

If you ask MSSA for the closest definition for a load inside a loop, it will return the closest store which might alias the load at any iteration.  This is what you want if you want to, for example, eliminate a load using a stored value.

What we really want here, though, is not MSSA for the load, as it exists in the loop.  Instead the question is, what would MSSA return after the loop is unrolled?  (It might not return the same def: alias analysis has more information after unrolling.)  We could speculatively unroll the loop and recompute MSSA, but that would be really expensive.  Instead, the code here is walking through the defs to try to find the def that will be relevant after unrolling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67612/new/

https://reviews.llvm.org/D67612





More information about the llvm-commits mailing list