Skip to content

Commit 0061829

Browse files
fmayerpuja2196
authored andcommitted
[MTE] Allow stack history for API level >=35 (#110328)
1 parent 2ad2ed9 commit 0061829

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

llvm/lib/Target/AArch64/AArch64StackTagging.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer(
487487
IRB.CreateCall(IRG_SP, {Constant::getNullValue(IRB.getInt64Ty())});
488488
Base->setName("basetag");
489489
auto TargetTriple = Triple(M.getTargetTriple());
490-
// This is not a stable ABI for now, so only allow in dev builds with API
491-
// level 10000.
490+
// This ABI will make it into Android API level 35.
492491
// The ThreadLong format is the same as with HWASan, but the entries for
493492
// stack MTE take two slots (16 bytes).
494493
if (ClRecordStackHistory == instr && TargetTriple.isAndroid() &&
495-
TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(10000) &&
494+
TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35) &&
496495
!AllocasToInstrument.empty()) {
497496
constexpr int StackMteSlot = -3;
498497
constexpr uint64_t TagMask = 0xFULL << 56;

llvm/test/CodeGen/AArch64/stack-tagging-dbg-assign-tag-offset.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
source_filename = "test.ll"
55
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6-
target triple = "aarch64--linux-android10000"
6+
target triple = "aarch64--linux-android35"
77

88
declare void @g(ptr, ptr, ptr, ptr, ptr, ptr)
99

llvm/test/CodeGen/AArch64/stack-tagging-dbg-declare-tag-offset.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; RUN: opt --try-experimental-debuginfo-iterators -aarch64-stack-tagging -stack-tagging-record-stack-history=instr -S -o - %s | FileCheck %s
77

88
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
9-
target triple = "aarch64--linux-android10000"
9+
target triple = "aarch64--linux-android35"
1010

1111
declare void @g(ptr, ptr, ptr, ptr, ptr, ptr)
1212

llvm/test/CodeGen/AArch64/stack-tagging-dbg-value-tag-offset-nopad.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: opt -aarch64-stack-tagging -stack-tagging-record-stack-history=instr -S -o - %s | FileCheck %s
22

33
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4-
target triple = "aarch64-unknown-linux-android10000"
4+
target triple = "aarch64-unknown-linux-android35"
55

66
define dso_local void @f() sanitize_memtag !dbg !14 {
77
%a1 = alloca i128, align 4

llvm/test/CodeGen/AArch64/stack-tagging-prologue.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7-
target triple = "aarch64--linux-android10000"
7+
target triple = "aarch64--linux-android35"
88

99
declare void @use32(ptr)
1010

0 commit comments

Comments
 (0)