[clang] [Driver][MachineOutliner] Support -moutline option for aarch64_be (PR #73223)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 23 01:29:03 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver
Author: dong jianqiang (dongjianqiang2)
<details>
<summary>Changes</summary>
This patch propagates the -moutline flag when target is aarch64_be,
fix warning: 'aarch64_be' does not support '-moutline'; flag ignored [-Woption-ignored]
---
Full diff: https://github.com/llvm/llvm-project/pull/73223.diff
2 Files Affected:
- (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+2-1)
- (modified) clang/test/Driver/aarch64-outliner.c (+2)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 5d2cd1959b06925..078f2ff80a21939 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2436,7 +2436,8 @@ void tools::addMachineOutlinerArgs(const Driver &D,
// Otherwise, add the proper mllvm flags.
if (!(Triple.isARM() || Triple.isThumb() ||
Triple.getArch() == llvm::Triple::aarch64 ||
- Triple.getArch() == llvm::Triple::aarch64_32)) {
+ Triple.getArch() == llvm::Triple::aarch64_32 ||
+ Triple.getArch() == llvm::Triple::aarch64_be)) {
D.Diag(diag::warn_drv_moutline_unsupported_opt) << Triple.getArchName();
} else {
addArg(Twine("-enable-machine-outliner"));
diff --git a/clang/test/Driver/aarch64-outliner.c b/clang/test/Driver/aarch64-outliner.c
index 42e43b433e282d3..06e5de11ec49ecd 100644
--- a/clang/test/Driver/aarch64-outliner.c
+++ b/clang/test/Driver/aarch64-outliner.c
@@ -1,7 +1,9 @@
// REQUIRES: aarch64-registered-target
// RUN: %clang --target=aarch64 -moutline -S %s -### 2>&1 | FileCheck %s -check-prefix=ON
+// RUN: %clang --target=aarch64_be -moutline -S %s -### 2>&1 | FileCheck %s -check-prefix=ON
// ON: "-mllvm" "-enable-machine-outliner"
// RUN: %clang --target=aarch64 -moutline -mno-outline -S %s -### 2>&1 | FileCheck %s -check-prefix=OFF
+// RUN: %clang --target=aarch64_be -moutline -mno-outline -S %s -### 2>&1 | FileCheck %s -check-prefix=OFF
// OFF: "-mllvm" "-enable-machine-outliner=never"
// RUN: %clang --target=x86_64 -moutline -S %s -### 2>&1 | FileCheck %s -check-prefix=WARN
// WARN: warning: 'x86_64' does not support '-moutline'; flag ignored [-Woption-ignored]
``````````
</details>
https://github.com/llvm/llvm-project/pull/73223
More information about the cfe-commits
mailing list