[X86] Prevent using X * rsqrt(X) to approximate sqrt when only sse1 is enabled.
authorCraig Topper <craig.topper@intel.com>
Fri, 24 Nov 2017 19:57:48 +0000 (19:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 24 Nov 2017 19:57:48 +0000 (19:57 +0000)
commit13ed01e6355bced6736f39e2910ba98f0293c328
tree5c93ff990fe854f6cee3edab4176bbb2d682d8fb
parent8375bec71ef0dad418dc01706d490300f35b1e74
[X86] Prevent using X * rsqrt(X) to approximate sqrt when only sse1 is enabled.

This optimization can occur after type legalization and emit a vselect with v4i32 type. But that type is not legal with sse1. This ultimately gets scalarized by the second type legalization that runs after vector op legalization, but that's really intended to handle the scalar types that might be introduced by legalizing vector ops.

For now just stop this from happening by disabling the optimization with sse1.

llvm-svn: 318965
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/sse1.ll