[PATCH] D149444: [ARM] Allow codegen for Armv6m eXecute-Only (XO) sections
Ties Stuij via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 28 06:38:48 PDT 2023
stuij created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
stuij requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, MaskRay.
Herald added projects: clang, LLVM.
This patch moves the overall lower-bound arch restriction for Arm XO sections
from v8m to v6m. Actual implementation of code-gen for v6m will follow in
follow-up patches, which will include an implementation of relocations needed to
support this.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D149444
Files:
clang/lib/Driver/ToolChains/Arch/ARM.cpp
llvm/lib/Target/ARM/ARMSubtarget.cpp
Index: llvm/lib/Target/ARM/ARMSubtarget.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -191,7 +191,7 @@
// Execute only support requires movt support
if (genExecuteOnly()) {
NoMovt = false;
- assert(hasV8MBaselineOps() && "Cannot generate execute-only code for this target");
+ assert(hasV6MOps() && "Cannot generate execute-only code for this target");
}
// Keep a pointer to static instruction cost data for the specified CPU.
@@ -431,7 +431,7 @@
// NOTE Windows on ARM needs to use mov.w/mov.t pairs to materialise 32-bit
// immediates as it is inherently position independent, and may be out of
// range otherwise.
- return !NoMovt && hasV8MBaselineOps() &&
+ return !NoMovt && hasV6MOps() &&
(isTargetWindows() || !OptMinSize || genExecuteOnly());
}
Index: clang/lib/Driver/ToolChains/Arch/ARM.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -779,7 +779,8 @@
if (Arg *A = Args.getLastArg(options::OPT_mexecute_only, options::OPT_mno_execute_only)) {
if (A->getOption().matches(options::OPT_mexecute_only)) {
if (getARMSubArchVersionNumber(Triple) < 7 &&
- llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2)
+ llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2 &&
+ llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6M)
D.Diag(diag::err_target_unsupported_execute_only) << Triple.getArchName();
else if (Arg *B = Args.getLastArg(options::OPT_mno_movt))
D.Diag(diag::err_opt_not_valid_with_opt)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149444.517898.patch
Type: text/x-patch
Size: 1834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230428/c95f7432/attachment-0001.bin>
More information about the cfe-commits
mailing list