[PATCH] D25276: [LoopVectorizer] Interleaved-mem-accesses analysis and getPtrStride

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 08:19:54 PDT 2016

sbaranga added a comment.

In https://reviews.llvm.org/D25276#574171, @mssimpso wrote:

> Intuitively it seems like we would want to use getPtrStride in the interleaved access analysis the same way we do in isConsecutivePtr. Is the issue here that we might add additional run-time checks that we aren't currently? We already call isConsecutivePtr for the pointer operand of every load/store in the loop. Would the additional checks then be duplicates?

isConsecutivePtr won't check for pointer wrapping (unless it's called from LAA), while there is a corner case here that would require us to check the pointer wrapping here (we can start emitting wrapping wide loads/stores otherwise).

In https://reviews.llvm.org/D25276#573854, @dorit wrote:

> so what exactly do you mean? It's already the very last thing we do in canVectorize...?

Sorry, I misunderstood your previous statement (I thought this analysis happened after the check for the number of predicates). We shouldn't be adding new predicates in the transformation stage, this should be done during the legality phase. But there we are adding predicates that will always be useful (we should get better codegen for AddRecExprs).
Maybe the best solution would be to try to make all pointers AddRecExprs in the legality stage for now?



More information about the llvm-commits mailing list