From 789549bea441f1347458505307db322aea3ac289 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 28 Apr 2021 11:09:50 +0200 Subject: [PATCH] [clang-cl] Map /QIntel-jcc-erratum to -mbranches-within-32B-boundaries --- clang/include/clang/Driver/Options.td | 4 +++- clang/test/Driver/cl-options.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index e70b793..06a21a9 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -5935,6 +5935,9 @@ def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">, def _SLASH_tune : CLCompileJoined<"tune:">, HelpText<"Set CPU for optimization without affecting instruction set">, Alias; +def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">, + HelpText<"Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum.">, + Alias; // Non-aliases: @@ -6131,7 +6134,6 @@ def _SLASH_LN : CLFlag<"LN">; def _SLASH_MP : CLJoined<"MP">; def _SLASH_Qfast_transcendentals : CLFlag<"Qfast_transcendentals">; def _SLASH_QIfist : CLFlag<"QIfist">; -def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">; def _SLASH_Qimprecise_fwaits : CLFlag<"Qimprecise_fwaits">; def _SLASH_Qpar : CLFlag<"Qpar">; def _SLASH_Qpar_report : CLJoined<"Qpar-report">; diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index 77427f9d..be90b3f 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -299,6 +299,10 @@ // RUN: %clang_cl /d1PP -### -- %s 2>&1 | FileCheck -check-prefix=d1PP %s // d1PP: -dD +// RUN: %clang_cl /c /QIntel-jcc-erratum -### -- %s 2>&1 | FileCheck -check-prefix=jcceratum %s +// jcceratum: "-mllvm" "-x86-branches-within-32B-boundaries" + + // We forward any unrecognized -W diagnostic options to cc1. // RUN: %clang_cl -Wunused-pragmas -### -- %s 2>&1 | FileCheck -check-prefix=WJoined %s // WJoined: "-cc1" -- 2.7.4