[llvm] [MTE] Allow stack history for API level >=35 (PR #110328)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 14:16:09 PDT 2024


https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/110328

None

>From e0e187dd90db50d8177a4c70b1dabfe1c5d65f0b Mon Sep 17 00:00:00 2001
From: Florian Mayer <fmayer at google.com>
Date: Fri, 27 Sep 2024 14:15:55 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 llvm/lib/Target/AArch64/AArch64StackTagging.cpp              | 5 ++---
 .../CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll   | 2 +-
 .../CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll  | 2 +-
 .../AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll      | 2 +-
 llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll          | 2 +-
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
index 72823fdcd858df..1d2b2573778283 100644
--- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
+++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -487,12 +487,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer(
       IRB.CreateCall(IRG_SP, {Constant::getNullValue(IRB.getInt64Ty())});
   Base->setName("basetag");
   auto TargetTriple = Triple(M.getTargetTriple());
-  // This is not a stable ABI for now, so only allow in dev builds with API
-  // level 10000.
+  // This ABI will make it into Android API level 35.
   // The ThreadLong format is the same as with HWASan, but the entries for
   // stack MTE take two slots (16 bytes).
   if (ClRecordStackHistory == instr && TargetTriple.isAndroid() &&
-      TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(10000) &&
+      TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35) &&
       !AllocasToInstrument.empty()) {
     constexpr int StackMteSlot = -3;
     constexpr uint64_t TagMask = 0xFULL << 56;
diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll
index a48a885a6c68e0..1e78e98bb78b28 100644
--- a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll
+++ b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll
@@ -3,7 +3,7 @@
 
 source_filename = "test.ll"
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-target triple = "aarch64--linux-android10000"
+target triple = "aarch64--linux-android35"
 
 declare void @g(ptr, ptr, ptr, ptr, ptr, ptr)
 
diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll
index e0efd37aad2c00..a2e6096d8cb920 100644
--- a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll
+++ b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll
@@ -6,7 +6,7 @@
 ; RUN: opt --try-experimental-debuginfo-iterators -aarch64-stack-tagging -stack-tagging-record-stack-history=instr -S -o - %s | FileCheck %s
 
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-target triple = "aarch64--linux-android10000"
+target triple = "aarch64--linux-android35"
 
 declare void @g(ptr, ptr, ptr, ptr, ptr, ptr)
 
diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll
index 093ddd3be3a56e..dc7c4039a44d24 100644
--- a/llvm/test/CodeGen/AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll
+++ b/llvm/test/CodeGen/AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -aarch64-stack-tagging -stack-tagging-record-stack-history=instr  -S -o - %s | FileCheck %s
 
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-target triple = "aarch64-unknown-linux-android10000"
+target triple = "aarch64-unknown-linux-android35"
 
 define dso_local void @f() sanitize_memtag !dbg !14 {
   %a1 = alloca i128, align 4
diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll b/llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll
index 40bc8bdd70703a..3eed6d45c77102 100644
--- a/llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll
+++ b/llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll
@@ -4,7 +4,7 @@
 
 
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-target triple = "aarch64--linux-android10000"
+target triple = "aarch64--linux-android35"
 
 declare void @use32(ptr)
 



More information about the llvm-commits mailing list