Pull in r322245 from upstream clang trunk (by Craig Topper):

[X86] Make -mavx512f imply -mfma and -mf16c in the frontend like it
  does in the backend.

  Similarly, make -mno-fma and -mno-f16c imply -mno-avx512f.

  Withou this  "-mno-sse -mavx512f" ends up with avx512f being enabled
  in the frontend but disabled in the backend.

Reported by:	pawel
PR:		225488
This commit is contained in:
Dimitry Andric 2018-01-28 16:10:40 +00:00
parent 2b4c1a7ffc
commit 48d95fd235
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328513

View File

@ -409,7 +409,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
if (Enabled) {
switch (Level) {
case AVX512F:
Features["avx512f"] = true;
Features["avx512f"] = Features["fma"] = Features["f16c"] = true;
LLVM_FALLTHROUGH;
case AVX2:
Features["avx2"] = true;
@ -623,6 +623,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
} else if (Name == "fma") {
if (Enabled)
setSSELevel(Features, AVX, Enabled);
else
setSSELevel(Features, AVX512F, Enabled);
} else if (Name == "fma4") {
setXOPLevel(Features, FMA4, Enabled);
} else if (Name == "xop") {
@ -632,6 +634,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
} else if (Name == "f16c") {
if (Enabled)
setSSELevel(Features, AVX, Enabled);
else
setSSELevel(Features, AVX512F, Enabled);
} else if (Name == "sha") {
if (Enabled)
setSSELevel(Features, SSE2, Enabled);