[llvm] r261360 - Fix incorrect selection of AVX512 sqrt when OptForSize is on

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 12:21:24 PST 2016


On 19 Feb 2016, at 21:14, Dimitry Andric via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: dim
> Date: Fri Feb 19 14:14:11 2016
> New Revision: 261360
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=261360&view=rev
> Log:
> Fix incorrect selection of AVX512 sqrt when OptForSize is on
> 
> Summary:
> When optimizing for size, sqrt calls can be incorrectly selected as
> AVX512 VSQRT instructions.  This is because X86InstrAVX512.td has a
> `Requires<[OptForSize]>` in its `avx512_sqrt_scalar` multiclass
> definition.  Even if the target does not support AVX512, the class can
> apparently still be chosen, leading to an incorrect selection of
> `vsqrtss`.
> 
> In PR26625, this lead to an assertion: Reg >= X86::FP0 && Reg <=
> X86::FP6 && "Expected FP register!", because the `vsqrtss` instruction
> requires an XMM register, which is not available on i686 CPUs.
> 
> Reviewers: grosbach, resistor, joker.eph
> 
> Subscribers: spatel, emaste, llvm-commits
> 
> Differential Revision: http://reviews.llvm.org/D17414

Hans, this one would be nice to get into 3.8.  I am unsure who the owner of the .td files is though.  Since it is under the X86 target, is the owner Nadav Rotem?

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/07c28e91/attachment.sig>


More information about the llvm-commits mailing list