This patch improve the target-specific cost model to better handle signed division by a power of 2. The immediate result is that this enables the SLP vectorizer to do a better job.
The ADD/CMP/SELECT/SRA is the expansion for the scalar version, which was added in r213758. I assume this is the cost we should return. The generated vector code still uses the target-independent series of SRA/SRL/ADD/SRA, however. I may need to clarify the comments, so suggestions are welcome.
We could also investigate using the ADD/CMP/SELECT/SRA combination for vectors, but that would require additional performance evaluation (and I think it's an orthogonal issue).
This should address PR20714.
Chad
s/vector/scalar