[X86] Don't disable xsave when avx is disabled. Implicitly enable xsave with avx...
authorCraig Topper <craig.topper@intel.com>
Fri, 26 Jun 2020 23:41:30 +0000 (16:41 -0700)
committerCraig Topper <craig.topper@intel.com>
Fri, 26 Jun 2020 23:45:44 +0000 (16:45 -0700)
commitd298acde828f4abc5e7c82ba1f6092890d910097
tree3400658fc2655595c3a0f6d2c36b720480bb728d
parentc918c1a91a03f612c1b1e81b82460fbf80fc592a
[X86] Don't disable xsave when avx is disabled. Implicitly enable xsave with avx is enabled and xsave wasn't explciitly disabled

CPUs with avx always have xsave, but some CPUs without avx also
have xsave. So we shouldn't disable xsave just because avx is
disabled. This would prevent xsave from being enabled with
-march=native on CPUs with xsave and not avx.

But we also don't want -mavx -mno-avx to leave xsave eanabled.
So only enable xsave if avx is enabled after processing all features.

I thought about just not turning xsave on with avx at all, but
there might be someone out there depending on it.
clang/lib/Basic/Targets/X86.cpp
clang/test/CodeGen/attr-target-x86.c