[PATCH] D22867: [LV] Untangle the concepts of uniform and scalar

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 11:12:52 PDT 2016


mssimpso added a comment.

In https://reviews.llvm.org/D22867#500844, @wmi wrote:

> There are two factors here:
>
> 1. Now calculateRegisterUsage only considers the pressure of vector register, not scalar register. TTI.getNumberOfRegisters only returns vector register number. Scalar register pressure is not modeled in loop vectorization.


This doesn't make sense to me. We use register pressure when deciding to unroll, and we surely do that when we're not vectorizing (VF = 1). I believe TTI.getNumberOfRegisters(true) is what returns the number of vector registers, but in a quick scan of calculateRegisterUsage it doesn't even look like we consider this. I think we just count the number of live intervals. Am I missing something?

> 2. induction variable has larger impact on register pressure than ORs above, it has live range across the loop while ORs generated have limited live range. If we don't add iv to VecValuesToIgnore, it may involve some impact from scalar register pressure increase into consideration, but it will definitely pessimize the maximum vector register pressure.

> 

>   I think it is also better to add GEP to VecValuesToIgnore too for non-consecutive memory access case.  although GEP has less impact on vector register pressure than iv.


It sounds like you're advocating to add values to VecValuesToIgnore if isScalarAfterVectorization is true rather than isUniformAfterVectorization? This would make sense to me if calculateRegisterUsage is only intended to track the pressure of vector registers, but I'm not sure that it is. Can you please clarify?


https://reviews.llvm.org/D22867





More information about the llvm-commits mailing list