We are caching TripCount of a loop in “EpilogueLoopVectorizationInfo.TripCount” during first pass ( Main Loop) vectorization. I see we use the cached value at “emitMinimumVectorEpilogueIterCountCheck” during the second pass( Epilog Vector loop).
–Snip–
BasicBlock *
EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(
Loop *L, BasicBlock *Bypass, BasicBlock *Insert) {
assert(EPI.TripCount &&
“Expected trip count to have been safed in the first pass.”);
assert(
(!isa(EPI.TripCount) ||
DT->dominates(cast(EPI.TripCount)->getParent(), Insert)) &&
“saved trip count does not dominate insertion point.”);
Value *TC = EPI.TripCount;
–Snip–
Can that be used in other places also in second pass? (TripCount = EPI.TripCount). In the trunk I see we are recomputing again via getOrCreateTripCount(L) during the second pass (Epilog vector loop)
is it guaranteed that trip count will always dominate the epilog vector loop and scalar loop ?