[PATCH] D39346: [LV] [ScalarEvolution] Fix PR34965 - Cache pointer stride information before LV code gen
Diego Caballero via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 15:27:15 PDT 2017
dcaballe added a comment.
In reply to Hal Finkel's comments in llvm-dev:
> "P.S. I agree with your conclusions based on your description of what's going on: We need to cache the results before we start transforming things. I also agree that we should potentially be concerned with maintaining the cache in the face of new predicates being added. Maybe we should instantiate the cached values as a separate setup after all predicates have been added?"
That is my concern. It's not clear to me when "all predicates have been added". replaceSymbolicStrideSCEV can be called from multiple routines, as I explained in Tentative Fix. I guess we could assume that all predicates have been added just before going into LV code gen. If that is the case, we could call 'collectPtrStride' only once, for example, in line 7668 (just before createVectorizedLoopSkeleton) and do something like the following in Legal->isConsecutivePtr():
if !PtrStrides.empty()
// Compute isConsecutivePtr using PtrStride information
else
// Compute isConsecutivePtr from scratch.
https://reviews.llvm.org/D39346
More information about the llvm-commits
mailing list