summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@arm.com>2018-09-28 08:55:19 +0000
committerDavid Spickett <david.spickett@arm.com>2018-09-28 08:55:19 +0000
commitea605913bed0eb9264c83fa8a91de064ffe8c74b (patch)
treeb45d4291e4acd5f98f8e31bda40ccbb568f01dd7
parenta799fe40dcb45f9f67a02538b64a5a01f4c7ace2 (diff)
downloadbcm5719-llvm-ea605913bed0eb9264c83fa8a91de064ffe8c74b.tar.gz
bcm5719-llvm-ea605913bed0eb9264c83fa8a91de064ffe8c74b.zip
[ARM] Allow execute only code on Cortex-m23
The NoMovt feature prevents the use of MOVW/MOVT instructions on Cortex-M23 for performance reasons. These instructions are required for execute only code so NoMovt should be disabled when that option is enabled. Differential Revision: https://reviews.llvm.org/D52551 llvm-svn: 343302
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp6
-rw-r--r--llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll2
-rw-r--r--llvm/test/CodeGen/ARM/execute-only-section.ll1
-rw-r--r--llvm/test/CodeGen/ARM/execute-only.ll1
4 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index 1c17b63a35d..b1d0761e323 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -188,8 +188,10 @@ void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
assert(hasV6T2Ops() || !hasThumb2());
// Execute only support requires movt support
- if (genExecuteOnly())
- assert(hasV8MBaselineOps() && !NoMovt && "Cannot generate execute-only code for this target");
+ if (genExecuteOnly()) {
+ NoMovt = false;
+ assert(hasV8MBaselineOps() && "Cannot generate execute-only code for this target");
+ }
// Keep a pointer to static instruction cost data for the specified CPU.
SchedModel = getSchedModelForCPU(CPUString);
diff --git a/llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll b/llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll
index 24c6a06d6af..5e4e718020e 100644
--- a/llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll
+++ b/llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll
@@ -2,6 +2,8 @@
; RUN: | FileCheck --check-prefix=CHECK-SUBW-ADDW %s
; RUN: llc < %s -mtriple=thumbv8m.base -mattr=+execute-only -O0 %s -o - \
; RUN: | FileCheck --check-prefix=CHECK-MOVW-MOVT-ADD %s
+; RUN: llc < %s -mtriple=thumbv8m.base -mcpu=cortex-m23 -mattr=+execute-only -O0 %s -o - \
+; RUN: | FileCheck --check-prefix=CHECK-MOVW-MOVT-ADD %s
; RUN: llc < %s -mtriple=thumbv8m.main -mattr=+execute-only -O0 %s -o - \
; RUN: | FileCheck --check-prefix=CHECK-SUBW-ADDW %s
diff --git a/llvm/test/CodeGen/ARM/execute-only-section.ll b/llvm/test/CodeGen/ARM/execute-only-section.ll
index a3313d8c2f7..8c7eb0c4376 100644
--- a/llvm/test/CodeGen/ARM/execute-only-section.ll
+++ b/llvm/test/CodeGen/ARM/execute-only-section.ll
@@ -1,5 +1,6 @@
; RUN: llc < %s -mtriple=thumbv7m -mattr=+execute-only %s -o - | FileCheck %s
; RUN: llc < %s -mtriple=thumbv8m.base -mattr=+execute-only %s -o - | FileCheck %s
+; RUN: llc < %s -mtriple=thumbv8m.base -mcpu=cortex-m23 -mattr=+execute-only %s -o - | FileCheck %s
; RUN: llc < %s -mtriple=thumbv8m.main -mattr=+execute-only %s -o - | FileCheck %s
; CHECK: .section .text,"axy",%progbits,unique,0
diff --git a/llvm/test/CodeGen/ARM/execute-only.ll b/llvm/test/CodeGen/ARM/execute-only.ll
index 3f42ca3b5f4..169f44c7ffa 100644
--- a/llvm/test/CodeGen/ARM/execute-only.ll
+++ b/llvm/test/CodeGen/ARM/execute-only.ll
@@ -1,4 +1,5 @@
; RUN: llc -mtriple=thumbv8m.base-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
+; RUN: llc -mtriple=thumbv8m.base-eabi -mcpu=cortex-m23 -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2BASE %s
; RUN: llc -mtriple=thumbv7m-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2 %s
; RUN: llc -mtriple=thumbv8m.main-eabi -mattr=+execute-only %s -o - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-T2 %s
OpenPOWER on IntegriCloud