From 556ea7d2e0ba09199e272509369449eb74c6cffc Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Mon, 28 Jan 2019 19:27:33 +0000 Subject: [PATCH] [AArch64] Add 'apple-latest' CPU alias The 'apple-latest' alias is supposed to provide a CPU that contains the latest Apple processor model supported by LLVM. This is supposed to be used by tools like lldb to provide a target that supports most of the CPU features. For now, this is mapped to Cyclone. Differential Revision: https://reviews.llvm.org/D56384 llvm-svn: 352412 --- llvm/lib/Target/AArch64/AArch64.td | 3 +++ llvm/test/CodeGen/AArch64/apple-latest-cpu.ll | 7 +++++++ llvm/test/CodeGen/AArch64/cpus.ll | 1 + 3 files changed, 11 insertions(+) create mode 100644 llvm/test/CodeGen/AArch64/apple-latest-cpu.ll diff --git a/llvm/lib/Target/AArch64/AArch64.td b/llvm/lib/Target/AArch64/AArch64.td index 079c4583c540..7ba64ffe5f92 100644 --- a/llvm/lib/Target/AArch64/AArch64.td +++ b/llvm/lib/Target/AArch64/AArch64.td @@ -715,6 +715,9 @@ def : ProcessorModel<"thunderx2t99", ThunderX2T99Model, [ProcThunderX2T99]>; // FIXME: HiSilicon TSV110 is currently modeled as a Cortex-A57. def : ProcessorModel<"tsv110", CortexA57Model, [ProcTSV110]>; +// Alias for the latest Apple processor model supported by LLVM. +def : ProcessorModel<"apple-latest", CycloneModel, [ProcCyclone]>; + //===----------------------------------------------------------------------===// // Assembly parser //===----------------------------------------------------------------------===// diff --git a/llvm/test/CodeGen/AArch64/apple-latest-cpu.ll b/llvm/test/CodeGen/AArch64/apple-latest-cpu.ll new file mode 100644 index 000000000000..033c3772af05 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/apple-latest-cpu.ll @@ -0,0 +1,7 @@ +; RUN: llc -mtriple=arm64-apple-ios -mcpu=apple-latest -stop-before=expand-isel-pseudos -o - 2>&1 < %s | FileCheck %s + +; CHECK-LABEL: @dummy +; CHECK: "target-cpu"="apple-latest" +define void @dummy() { + ret void +} diff --git a/llvm/test/CodeGen/AArch64/cpus.ll b/llvm/test/CodeGen/AArch64/cpus.ll index d4a32bd278ca..c639ee0beff2 100644 --- a/llvm/test/CodeGen/AArch64/cpus.ll +++ b/llvm/test/CodeGen/AArch64/cpus.ll @@ -18,6 +18,7 @@ ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=kryo 2>&1 | FileCheck %s ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=thunderx2t99 2>&1 | FileCheck %s ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=tsv110 2>&1 | FileCheck %s +; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=apple-latest 2>&1 | FileCheck %s ; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=invalidcpu 2>&1 | FileCheck %s --check-prefix=INVALID ; CHECK-NOT: {{.*}} is not a recognized processor for this target