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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 11:33:00 PDT 2016


mkuper added a comment.

In https://reviews.llvm.org/D22867#500889, @mssimpso wrote:

> 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?


calculateRegisterUsage() will skip values in VecValuesToIgnore when VF > 1. So when we're only unrolling it will estimate scalar register pressure (by counting all live intervals, which are all scalar), but when we're both vectorizing and unrolling, it will estimate vector register pressure (by considering only the live intervals that correspond to values that will actually be vectorized). 
I'm not saying this necessarily makes sense, just describing the state of the world.


https://reviews.llvm.org/D22867





More information about the llvm-commits mailing list