From 1a2e48066b2e65a7ed9e2da5eff6bf96c98dd7b0 Mon Sep 17 00:00:00 2001 From: Simon Dardis Date: Tue, 26 Sep 2017 15:01:21 +0000 Subject: [PATCH] [mips] Accept but ignore -m(no-)branch-likely -mbranch-likely and -mno-branch-likely are used in some build systems for some MIPS targets. Accept these options but ignore them as they are an (de)optimiztion hint, and that branch likely instructions were deprecated but not removed from MIPS32 and MIPS64 ISAs. Reviewers: atanasyan, nitesh.jain Differential Revision: https://reviews.llvm.org/D38168 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314213 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 4 ++++ test/Driver/mips-features.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 6406e26ba5..32d5eac69b 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -2047,6 +2047,10 @@ def mcheck_zero_division : Flag<["-"], "mcheck-zero-division">, Group; def mno_check_zero_division : Flag<["-"], "mno-check-zero-division">, Group; def mcompact_branches_EQ : Joined<["-"], "mcompact-branches=">, Group; +def mbranch_likely : Flag<["-"], "mbranch-likely">, Group, + IgnoredGCCCompat; +def mno_branch_likely : Flag<["-"], "mno-branch-likely">, Group, + IgnoredGCCCompat; def mdsp : Flag<["-"], "mdsp">, Group; def mno_dsp : Flag<["-"], "mno-dsp">, Group; def mdspr2 : Flag<["-"], "mdspr2">, Group; diff --git a/test/Driver/mips-features.c b/test/Driver/mips-features.c index 5f6833e686..a9db0f1017 100644 --- a/test/Driver/mips-features.c +++ b/test/Driver/mips-features.c @@ -392,3 +392,13 @@ // LONG-CALLS-ON: "-target-feature" "+long-calls" // LONG-CALLS-OFF: "-target-feature" "-long-calls" // LONG-CALLS-DEF-NOT: "long-calls" +// +// -mbranch-likely +// RUN: %clang -target -mips-mti-linux-gnu -### -c %s -mbranch-likely 2>&1 \ +// RUN: | FileCheck --check-prefix=BRANCH-LIKELY %s +// BRANCH-LIKELY: argument unused during compilation: '-mbranch-likely' +// +// -mno-branch-likely +// RUN: %clang -target -mips-mti-linux-gnu -### -c %s -mno-branch-likely 2>&1 \ +// RUN: | FileCheck --check-prefix=NO-BRANCH-LIKELY %s +// NO-BRANCH-LIKELY: argument unused during compilation: '-mno-branch-likely' -- 2.40.0