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

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 02:16:47 PST 2018


Merged to 6.0 in r323741.

On Thu, Jan 11, 2018 at 2:37 AM, Craig Topper via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: ctopper
> Date: Wed Jan 10 17:37:59 2018
> New Revision: 322245
>
> URL: http://llvm.org/viewvc/llvm-project?rev=322245&view=rev
> Log:
> [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.
>
> Modified:
>     cfe/trunk/lib/Basic/Targets/X86.cpp
>
> Modified: cfe/trunk/lib/Basic/Targets/X86.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/
> Targets/X86.cpp?rev=322245&r1=322244&r2=322245&view=diff
> ============================================================
> ==================
> --- cfe/trunk/lib/Basic/Targets/X86.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets/X86.cpp Wed Jan 10 17:37:59 2018
> @@ -430,7 +430,7 @@ void X86TargetInfo::setSSELevel(llvm::St
>    if (Enabled) {
>      switch (Level) {
>      case AVX512F:
> -      Features["avx512f"] = true;
> +      Features["avx512f"] = Features["fma"] = Features["f16c"] = true;
>        LLVM_FALLTHROUGH;
>      case AVX2:
>        Features["avx2"] = true;
> @@ -644,6 +644,8 @@ void X86TargetInfo::setFeatureEnabledImp
>    } 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") {
> @@ -653,6 +655,8 @@ void X86TargetInfo::setFeatureEnabledImp
>    } 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);
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180130/ef5f9375/attachment.html>


More information about the cfe-commits mailing list