From c6ed91e100fad24ccfd6602997879c0f543f4935 Mon Sep 17 00:00:00 2001 From: "Diogo N. Sampaio" Date: Fri, 4 Jan 2019 11:04:18 +0000 Subject: [PATCH] [AArch64] Add command-line option predres Prediction control instructions are only mandatory from v8.5a onwards but is optional from Armv8.0-A. This patch adds a command line option to enable it by it's own. Differential Revision: https://reviews.llvm.org/D56007 llvm-svn: 350385 --- llvm/include/llvm/Support/AArch64TargetParser.def | 1 + llvm/include/llvm/Support/AArch64TargetParser.h | 1 + llvm/unittests/Support/TargetParserTest.cpp | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/AArch64TargetParser.def b/llvm/include/llvm/Support/AArch64TargetParser.def index 1493b7a79c60c..f1fcb83d3797c 100644 --- a/llvm/include/llvm/Support/AArch64TargetParser.def +++ b/llvm/include/llvm/Support/AArch64TargetParser.def @@ -74,6 +74,7 @@ AARCH64_ARCH_EXT_NAME("rng", AArch64::AEK_RAND, "+rand", "-rand") AARCH64_ARCH_EXT_NAME("memtag", AArch64::AEK_MTE, "+mte", "-mte") AARCH64_ARCH_EXT_NAME("ssbs", AArch64::AEK_SSBS, "+ssbs", "-ssbs") AARCH64_ARCH_EXT_NAME("sb", AArch64::AEK_SB, "+sb", "-sb") +AARCH64_ARCH_EXT_NAME("predres", AArch64::AEK_PREDRES, "+predres", "-predres") #undef AARCH64_ARCH_EXT_NAME #ifndef AARCH64_CPU_NAME diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/Support/AArch64TargetParser.h index 648aa941379e4..76b77d4744289 100644 --- a/llvm/include/llvm/Support/AArch64TargetParser.h +++ b/llvm/include/llvm/Support/AArch64TargetParser.h @@ -49,6 +49,7 @@ enum ArchExtKind : unsigned { AEK_MTE = 1 << 19, AEK_SSBS = 1 << 20, AEK_SB = 1 << 21, + AEK_PREDRES = 1 << 22, }; enum class ArchKind { diff --git a/llvm/unittests/Support/TargetParserTest.cpp b/llvm/unittests/Support/TargetParserTest.cpp index 3676deec6319f..28e995eae6bf7 100644 --- a/llvm/unittests/Support/TargetParserTest.cpp +++ b/llvm/unittests/Support/TargetParserTest.cpp @@ -990,7 +990,9 @@ TEST(TargetParserTest, AArch64ArchExtFeature) { {"rng", "norng", "+rand", "-rand"}, {"memtag", "nomemtag", "+mte", "-mte"}, {"ssbs", "nossbs", "+ssbs", "-ssbs"}, - {"sb", "nosb", "+sb", "-sb"}}; + {"sb", "nosb", "+sb", "-sb"}, + {"predres", "nopredres", "+predres", "-predres"} +}; for (unsigned i = 0; i < array_lengthof(ArchExt); i++) { EXPECT_EQ(StringRef(ArchExt[i][2]),