[PATCH] D32667: [Polly] Introduce VirtualUse. NFC.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 08:33:32 PDT 2017


Meinersbur added inline comments.


================
Comment at: lib/CodeGen/BlockGenerators.cpp:185
+    // not precomputed. These tests fail without this, but I think
+    // trySynthesizeNewValue would just re-synthesize the same instructions.
+    if ((New = BBMap.lookup(Old)))
----------------
grosser wrote:
> Are they really pre-compute is it more that we already synthesized them once and consequently don't need to re-synthesize them again.
This "caching" seems unintentional because it happens only in 3 test cases.

If we want to cache already synthesized values, we should let `SCEVExpander` do it. `SCEVExpander` already has a map of already synthesized values. More importantly, it also caches intermediate values and does not necessarily put them into the current BB, but also into dominating BBs such that they values can be reused in multiple BBs.

That is, `SCEVExpander` could do caching more efficiently. Unfortunately. we create a new `SCEVExpander` object (in `expandCodeFor`) for each value we want to synthesize, so its cache is initalized empty.


https://reviews.llvm.org/D32667





More information about the llvm-commits mailing list