[llvm] [ASAN] Add "asan_instrumented" llvm ir attribute to identify AddressSanitizer instrumented globals (PR #68865)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 03:20:07 PDT 2023
https://github.com/skc7 updated https://github.com/llvm/llvm-project/pull/68865
>From 5c8a5b3bec10c3c04b6bc039c32dfe4acb6fdf4c Mon Sep 17 00:00:00 2001
From: skc7 <Krishna.Sankisa at amd.com>
Date: Thu, 12 Oct 2023 14:05:48 +0530
Subject: [PATCH 1/3] [ASAN] Add AsanInstrumented llvm ir attribute to identify
asan instrumented globals
---
llvm/include/llvm/Bitcode/LLVMBitCodes.h | 1 +
llvm/include/llvm/IR/Attributes.h | 3 +++
llvm/include/llvm/IR/Attributes.td | 3 +++
llvm/lib/AsmParser/LLLexer.cpp | 1 +
llvm/lib/AsmParser/LLParser.cpp | 8 ++++++++
llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 ++
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 ++
llvm/lib/IR/Attributes.cpp | 7 +++++++
8 files changed, 27 insertions(+)
diff --git a/llvm/include/llvm/Bitcode/LLVMBitCodes.h b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
index 2a522c517c7fa2f..1f802a45698c93b 100644
--- a/llvm/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
@@ -718,6 +718,7 @@ enum AttributeKindCodes {
ATTR_KIND_NOFPCLASS = 87,
ATTR_KIND_OPTIMIZE_FOR_DEBUGGING = 88,
ATTR_KIND_WRITABLE = 89,
+ ATTR_KIND_ASAN_INSTRUMENTED = 90,
};
enum ComdatSelectionKindCodes {
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index db33b5400471685..eb02158f15a1254 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -251,6 +251,9 @@ class Attribute {
/// Return the FPClassTest for nofpclass
FPClassTest getNoFPClass() const;
+ /// Return if global variable is instrumented by AddrSanitizer.
+ bool isAsanInstrumented() const;
+
/// The Attribute is converted to a string of equivalent mnemonic. This
/// is, presumably, for writing out the mnemonics for the assembly writer.
std::string getAsString(bool InAttrGrp = false) const;
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 693ffbbf32e0e33..29af209a3632a62 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -276,6 +276,9 @@ def SanitizeHWAddress : EnumAttr<"sanitize_hwaddress", [FnAttr]>;
/// MemTagSanitizer is on.
def SanitizeMemTag : EnumAttr<"sanitize_memtag", [FnAttr]>;
+/// Attribute to identify global variables instrumented by AddrSanitizer.
+def AsanInstrumented : EnumAttr<"asan_instrumented", []>;
+
/// Speculative Load Hardening is enabled.
///
/// Note that this uses the default compatibility (always compatible during
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 284a4c64c6793ef..96493a474892801 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -583,6 +583,7 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(no_sanitize_address);
KEYWORD(no_sanitize_hwaddress);
KEYWORD(sanitize_address_dyninit);
+ KEYWORD(asan_instrumented);
KEYWORD(ccc);
KEYWORD(fastcc);
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 42f306a99d5eefa..cbd21934d37d6fd 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1525,6 +1525,14 @@ bool LLParser::parseFnAttributeValuePairs(AttrBuilder &B,
continue;
}
+ if (Token == lltok::kw_asan_instrumented) {
+ if (parseToken(lltok::kw_asan_instrumented,
+ "expected 'asan_instrumented'"))
+ return true;
+ B.addAttribute(Attribute::AsanInstrumented);
+ continue;
+ }
+
SMLoc Loc = Lex.getLoc();
if (Token == lltok::kw_builtin)
BuiltinLoc = Loc;
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 747968b51407cd9..8602106c348714c 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1982,6 +1982,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
return Attribute::NullPointerIsValid;
case bitc::ATTR_KIND_OPTIMIZE_FOR_DEBUGGING:
return Attribute::OptimizeForDebugging;
+ case bitc::ATTR_KIND_ASAN_INSTRUMENTED:
+ return Attribute::AsanInstrumented;
case bitc::ATTR_KIND_OPT_FOR_FUZZING:
return Attribute::OptForFuzzing;
case bitc::ATTR_KIND_OPTIMIZE_FOR_SIZE:
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 5e3341d4de13323..9520bb6b024452e 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -792,6 +792,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
return bitc::ATTR_KIND_SANITIZE_THREAD;
case Attribute::SanitizeMemory:
return bitc::ATTR_KIND_SANITIZE_MEMORY;
+ case Attribute::AsanInstrumented:
+ return bitc::ATTR_KIND_ASAN_INSTRUMENTED;
case Attribute::SpeculativeLoadHardening:
return bitc::ATTR_KIND_SPECULATIVE_LOAD_HARDENING;
case Attribute::SwiftError:
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 10a74ed68a392c6..91080f207df1b3d 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -408,6 +408,10 @@ FPClassTest Attribute::getNoFPClass() const {
return static_cast<FPClassTest>(pImpl->getValueAsInt());
}
+bool Attribute::isAsanInstrumented() const {
+ return hasAttribute(Attribute::AsanInstrumented);
+}
+
static const char *getModRefStr(ModRefInfo MR) {
switch (MR) {
case ModRefInfo::NoModRef:
@@ -562,6 +566,9 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
return Result;
}
+ if (hasAttribute(Attribute::AsanInstrumented))
+ return "asan_instrumented";
+
// Convert target-dependent attributes to strings of the form:
//
// "kind"
>From 22c90ff13136ff3db069ab262a905f015407350f Mon Sep 17 00:00:00 2001
From: skc7 <Krishna.Sankisa at amd.com>
Date: Thu, 2 Nov 2023 12:36:11 +0530
Subject: [PATCH 2/3] [ASAN] Add sanitized_padded_global llvm ir attribute to
identify sanitizer instrumented globals
---
llvm/include/llvm/Bitcode/LLVMBitCodes.h | 2 +-
llvm/include/llvm/IR/Attributes.h | 2 +-
llvm/include/llvm/IR/Attributes.td | 4 ++--
llvm/lib/AsmParser/LLLexer.cpp | 2 +-
llvm/lib/AsmParser/LLParser.cpp | 8 ++++----
llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 ++--
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 4 ++--
llvm/lib/IR/Attributes.cpp | 8 ++++----
llvm/test/Assembler/globalvariable-attributes.ll | 5 ++++-
9 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/llvm/include/llvm/Bitcode/LLVMBitCodes.h b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
index 1f802a45698c93b..a15aa6344aa5608 100644
--- a/llvm/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
@@ -718,7 +718,7 @@ enum AttributeKindCodes {
ATTR_KIND_NOFPCLASS = 87,
ATTR_KIND_OPTIMIZE_FOR_DEBUGGING = 88,
ATTR_KIND_WRITABLE = 89,
- ATTR_KIND_ASAN_INSTRUMENTED = 90,
+ ATTR_KIND_SANITIZED_PADDED_GLOBAL = 90,
};
enum ComdatSelectionKindCodes {
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index eb02158f15a1254..9223577dc7d60f1 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -252,7 +252,7 @@ class Attribute {
FPClassTest getNoFPClass() const;
/// Return if global variable is instrumented by AddrSanitizer.
- bool isAsanInstrumented() const;
+ bool isSanitizedPaddedGlobal() const;
/// The Attribute is converted to a string of equivalent mnemonic. This
/// is, presumably, for writing out the mnemonics for the assembly writer.
diff --git a/llvm/include/llvm/IR/Attributes.td b/llvm/include/llvm/IR/Attributes.td
index 29af209a3632a62..19870fec4795fdc 100644
--- a/llvm/include/llvm/IR/Attributes.td
+++ b/llvm/include/llvm/IR/Attributes.td
@@ -276,8 +276,8 @@ def SanitizeHWAddress : EnumAttr<"sanitize_hwaddress", [FnAttr]>;
/// MemTagSanitizer is on.
def SanitizeMemTag : EnumAttr<"sanitize_memtag", [FnAttr]>;
-/// Attribute to identify global variables instrumented by AddrSanitizer.
-def AsanInstrumented : EnumAttr<"asan_instrumented", []>;
+/// Attribute to identify global variables instrumented by Sanitizers.
+def SanitizedPaddedGlobal : EnumAttr<"sanitized_padded_global", []>;
/// Speculative Load Hardening is enabled.
///
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 96493a474892801..e516cfa99cfddcb 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -583,7 +583,7 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(no_sanitize_address);
KEYWORD(no_sanitize_hwaddress);
KEYWORD(sanitize_address_dyninit);
- KEYWORD(asan_instrumented);
+ KEYWORD(sanitized_padded_global);
KEYWORD(ccc);
KEYWORD(fastcc);
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index cbd21934d37d6fd..d2858f92b555492 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1525,11 +1525,11 @@ bool LLParser::parseFnAttributeValuePairs(AttrBuilder &B,
continue;
}
- if (Token == lltok::kw_asan_instrumented) {
- if (parseToken(lltok::kw_asan_instrumented,
- "expected 'asan_instrumented'"))
+ if (Token == lltok::kw_sanitized_padded_global) {
+ if (parseToken(lltok::kw_sanitized_padded_global,
+ "expected 'sanitized_padded_global'"))
return true;
- B.addAttribute(Attribute::AsanInstrumented);
+ B.addAttribute(Attribute::SanitizedPaddedGlobal);
continue;
}
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 8602106c348714c..616cc6e7ab8a0e0 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1982,8 +1982,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
return Attribute::NullPointerIsValid;
case bitc::ATTR_KIND_OPTIMIZE_FOR_DEBUGGING:
return Attribute::OptimizeForDebugging;
- case bitc::ATTR_KIND_ASAN_INSTRUMENTED:
- return Attribute::AsanInstrumented;
+ case bitc::ATTR_KIND_SANITIZED_PADDED_GLOBAL:
+ return Attribute::SanitizedPaddedGlobal;
case bitc::ATTR_KIND_OPT_FOR_FUZZING:
return Attribute::OptForFuzzing;
case bitc::ATTR_KIND_OPTIMIZE_FOR_SIZE:
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 9520bb6b024452e..d907eb5767ff55b 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -792,8 +792,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
return bitc::ATTR_KIND_SANITIZE_THREAD;
case Attribute::SanitizeMemory:
return bitc::ATTR_KIND_SANITIZE_MEMORY;
- case Attribute::AsanInstrumented:
- return bitc::ATTR_KIND_ASAN_INSTRUMENTED;
+ case Attribute::SanitizedPaddedGlobal:
+ return bitc::ATTR_KIND_SANITIZED_PADDED_GLOBAL;
case Attribute::SpeculativeLoadHardening:
return bitc::ATTR_KIND_SPECULATIVE_LOAD_HARDENING;
case Attribute::SwiftError:
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 91080f207df1b3d..1f0510c95f13674 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -408,8 +408,8 @@ FPClassTest Attribute::getNoFPClass() const {
return static_cast<FPClassTest>(pImpl->getValueAsInt());
}
-bool Attribute::isAsanInstrumented() const {
- return hasAttribute(Attribute::AsanInstrumented);
+bool Attribute::isSanitizedPaddedGlobal() const {
+ return hasAttribute(Attribute::SanitizedPaddedGlobal);
}
static const char *getModRefStr(ModRefInfo MR) {
@@ -566,8 +566,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
return Result;
}
- if (hasAttribute(Attribute::AsanInstrumented))
- return "asan_instrumented";
+ if (hasAttribute(Attribute::SanitizedPaddedGlobal))
+ return "sanitized_padded_global";
// Convert target-dependent attributes to strings of the form:
//
diff --git a/llvm/test/Assembler/globalvariable-attributes.ll b/llvm/test/Assembler/globalvariable-attributes.ll
index 544f9bdb270e99a..071edd2904f5303 100644
--- a/llvm/test/Assembler/globalvariable-attributes.ll
+++ b/llvm/test/Assembler/globalvariable-attributes.ll
@@ -9,8 +9,10 @@
@g7 = global i32 2, sanitize_address_dyninit, align 4
@g8 = global i32 2, sanitize_memtag, align 4
@g9 = global i32 2, no_sanitize_address, no_sanitize_hwaddress, sanitize_memtag, align 4
+ at g10 = global i32 2 #1
attributes #0 = { "string" = "value" nobuiltin norecurse }
+attributes #1 = { sanitized_padded_global }
; CHECK: @g1 = global i32 7 #0
; CHECK: @g2 = global i32 2, align 4 #1
@@ -21,9 +23,10 @@ attributes #0 = { "string" = "value" nobuiltin norecurse }
; CHECK: @g7 = global i32 2, sanitize_address_dyninit, align 4
; CHECK: @g8 = global i32 2, sanitize_memtag, align 4
; CHECK: @g9 = global i32 2, no_sanitize_address, no_sanitize_hwaddress, sanitize_memtag, align 4
+; CHECK: @g10 = global i32 2 #4
; CHECK: attributes #0 = { "key"="value" "key2"="value2" }
; CHECK: attributes #1 = { "key3"="value3" }
; CHECK: attributes #2 = { nobuiltin norecurse "string"="value" }
; CHECK: attributes #3 = { nobuiltin norecurse "key5"="value5" "string"="value" }
-
+; CHECK: attributes #4 = { sanitized_padded_global }
>From 3bb9733304482331030fb705fad785b613abd123 Mon Sep 17 00:00:00 2001
From: skc7 <Krishna.Sankisa at amd.com>
Date: Thu, 2 Nov 2023 15:49:18 +0530
Subject: [PATCH 3/3] [ASAN] Bitcode compatibility test update for
sanitized_padded_global attribute
---
llvm/test/Bitcode/compatibility.ll | 202 +++++++++++++++--------------
1 file changed, 103 insertions(+), 99 deletions(-)
diff --git a/llvm/test/Bitcode/compatibility.ll b/llvm/test/Bitcode/compatibility.ll
index 90f4c0ff7443b09..627587d28253676 100644
--- a/llvm/test/Bitcode/compatibility.ll
+++ b/llvm/test/Bitcode/compatibility.ll
@@ -210,12 +210,14 @@ declare void @g.f1()
@g.no_sanitize_multiple = global i32 0, no_sanitize_address, no_sanitize_hwaddress
@g.sanitize_address_dyninit = global i32 0, sanitize_address_dyninit
@g.sanitize_multiple = global i32 0, sanitize_memtag, sanitize_address_dyninit
+ at g.sanitized_padded_global = global i32 0 sanitized_padded_global
; CHECK: @g.no_sanitize_address = global i32 0, no_sanitize_address
; CHECK: @g.no_sanitize_hwaddress = global i32 0, no_sanitize_hwaddress
; CHECK: @g.sanitize_memtag = global i32 0, sanitize_memtag
; CHECK: @g.no_sanitize_multiple = global i32 0, no_sanitize_address, no_sanitize_hwaddress
; CHECK: @g.sanitize_address_dyninit = global i32 0, sanitize_address_dyninit
; CHECK: @g.sanitize_multiple = global i32 0, sanitize_memtag, sanitize_address_dyninit
+; CHECK: @g.sanitized_padded_global = global i32 0 #0
;; Aliases
; Format: @<Name> = [Linkage] [Visibility] [DLLStorageClass] [ThreadLocal]
@@ -587,76 +589,76 @@ declare void @f.local_unnamed_addr() local_unnamed_addr
; Functions -- fn Attrs (Function attributes)
declare void @f.alignstack4() alignstack(4)
-; CHECK: declare void @f.alignstack4() #0
+; CHECK: declare void @f.alignstack4() #1
declare void @f.alignstack8() alignstack(8)
-; CHECK: declare void @f.alignstack8() #1
+; CHECK: declare void @f.alignstack8() #2
declare void @f.alwaysinline() alwaysinline
-; CHECK: declare void @f.alwaysinline() #2
+; CHECK: declare void @f.alwaysinline() #3
declare void @f.cold() cold
-; CHECK: declare void @f.cold() #3
+; CHECK: declare void @f.cold() #4
declare void @f.convergent() convergent
-; CHECK: declare void @f.convergent() #4
+; CHECK: declare void @f.convergent() #5
declare void @f.inlinehint() inlinehint
-; CHECK: declare void @f.inlinehint() #5
+; CHECK: declare void @f.inlinehint() #6
declare void @f.jumptable() unnamed_addr jumptable
-; CHECK: declare void @f.jumptable() unnamed_addr #6
+; CHECK: declare void @f.jumptable() unnamed_addr #7
declare void @f.minsize() minsize
-; CHECK: declare void @f.minsize() #7
+; CHECK: declare void @f.minsize() #8
declare void @f.naked() naked
-; CHECK: declare void @f.naked() #8
+; CHECK: declare void @f.naked() #9
declare void @f.nobuiltin() nobuiltin
-; CHECK: declare void @f.nobuiltin() #9
+; CHECK: declare void @f.nobuiltin() #10
declare void @f.noduplicate() noduplicate
-; CHECK: declare void @f.noduplicate() #10
+; CHECK: declare void @f.noduplicate() #11
declare void @f.noimplicitfloat() noimplicitfloat
-; CHECK: declare void @f.noimplicitfloat() #11
+; CHECK: declare void @f.noimplicitfloat() #12
declare void @f.noinline() noinline
-; CHECK: declare void @f.noinline() #12
+; CHECK: declare void @f.noinline() #13
declare void @f.nonlazybind() nonlazybind
-; CHECK: declare void @f.nonlazybind() #13
+; CHECK: declare void @f.nonlazybind() #14
declare void @f.noredzone() noredzone
-; CHECK: declare void @f.noredzone() #14
+; CHECK: declare void @f.noredzone() #15
declare void @f.noreturn() noreturn
-; CHECK: declare void @f.noreturn() #15
+; CHECK: declare void @f.noreturn() #16
declare void @f.nounwind() nounwind
-; CHECK: declare void @f.nounwind() #16
+; CHECK: declare void @f.nounwind() #17
declare void @f.optnone() noinline optnone
-; CHECK: declare void @f.optnone() #17
+; CHECK: declare void @f.optnone() #18
declare void @f.optsize() optsize
-; CHECK: declare void @f.optsize() #18
+; CHECK: declare void @f.optsize() #19
declare void @f.readnone() readnone
-; CHECK: declare void @f.readnone() #19
+; CHECK: declare void @f.readnone() #20
declare void @f.readonly() readonly
-; CHECK: declare void @f.readonly() #20
+; CHECK: declare void @f.readonly() #21
declare void @f.returns_twice() returns_twice
-; CHECK: declare void @f.returns_twice() #21
+; CHECK: declare void @f.returns_twice() #22
declare void @f.safestack() safestack
-; CHECK: declare void @f.safestack() #22
+; CHECK: declare void @f.safestack() #23
declare void @f.sanitize_address() sanitize_address
-; CHECK: declare void @f.sanitize_address() #23
+; CHECK: declare void @f.sanitize_address() #24
declare void @f.sanitize_memory() sanitize_memory
-; CHECK: declare void @f.sanitize_memory() #24
+; CHECK: declare void @f.sanitize_memory() #25
declare void @f.sanitize_thread() sanitize_thread
-; CHECK: declare void @f.sanitize_thread() #25
+; CHECK: declare void @f.sanitize_thread() #26
declare void @f.ssp() ssp
-; CHECK: declare void @f.ssp() #26
+; CHECK: declare void @f.ssp() #27
declare void @f.sspreq() sspreq
-; CHECK: declare void @f.sspreq() #27
+; CHECK: declare void @f.sspreq() #28
declare void @f.sspstrong() sspstrong
-; CHECK: declare void @f.sspstrong() #28
+; CHECK: declare void @f.sspstrong() #29
declare void @f.thunk() "thunk"
-; CHECK: declare void @f.thunk() #29
+; CHECK: declare void @f.thunk() #30
declare void @f.uwtable() uwtable
-; CHECK: declare void @f.uwtable() #30
+; CHECK: declare void @f.uwtable() #31
declare void @f.kvpair() "cpu"="cortex-a8"
-; CHECK:declare void @f.kvpair() #31
+; CHECK:declare void @f.kvpair() #32
declare void @f.norecurse() norecurse
-; CHECK: declare void @f.norecurse() #32
+; CHECK: declare void @f.norecurse() #33
declare void @f.inaccessiblememonly() inaccessiblememonly
-; CHECK: declare void @f.inaccessiblememonly() #33
+; CHECK: declare void @f.inaccessiblememonly() #34
declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
-; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
-declare void @f.strictfp() #35
+; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #35
+declare void @f.strictfp() #36
; Functions -- section
declare void @f.section() section "80"
@@ -721,7 +723,7 @@ declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
; Functions -- Personality constant
declare void @llvm.donothing() nounwind readnone
-; CHECK: declare void @llvm.donothing() #35
+; CHECK: declare void @llvm.donothing() #36
define void @f.no_personality() personality i8 3 {
; CHECK: define void @f.no_personality() personality i8 3
invoke void @llvm.donothing() to label %normal unwind label %exception
@@ -1556,12 +1558,12 @@ exit:
; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
call void @f.nobuiltin() builtin
- ; CHECK: call void @f.nobuiltin() #51
+ ; CHECK: call void @f.nobuiltin() #52
call fastcc noalias ptr @f.noalias() noinline
- ; CHECK: call fastcc noalias ptr @f.noalias() #12
+ ; CHECK: call fastcc noalias ptr @f.noalias() #13
tail call ghccc nonnull ptr @f.nonnull() minsize
- ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #7
+ ; CHECK: tail call ghccc nonnull ptr @f.nonnull() #8
freeze i32 %op1
; CHECK: freeze i32 %op1
@@ -1929,10 +1931,10 @@ normal:
declare void @f.writeonly() writeonly
-; CHECK: declare void @f.writeonly() #42
+; CHECK: declare void @f.writeonly() #43
declare void @f.speculatable() speculatable
-; CHECK: declare void @f.speculatable() #43
+; CHECK: declare void @f.speculatable() #44
;; Constant Expressions
@@ -1943,16 +1945,16 @@ define ptr @constexpr() {
define void @instructions.strictfp() strictfp {
call void @f.strictfp() strictfp
- ; CHECK: call void @f.strictfp() #44
+ ; CHECK: call void @f.strictfp() #45
ret void
}
declare void @f.nosanitize_coverage() nosanitize_coverage
-; CHECK: declare void @f.nosanitize_coverage() #45
+; CHECK: declare void @f.nosanitize_coverage() #46
declare void @f.disable_sanitizer_instrumentation() disable_sanitizer_instrumentation
-; CHECK: declare void @f.disable_sanitizer_instrumentation() #46
+; CHECK: declare void @f.disable_sanitizer_instrumentation() #47
; immarg attribute
declare void @llvm.test.immarg.intrinsic(i32 immarg)
@@ -1975,10 +1977,10 @@ declare void @f.allocsize_two(i32, i32) allocsize(1, 0)
; CHECK: declare void @f.allocsize_two(i32, i32)
declare void @f.nosanitize_bounds() nosanitize_bounds
-; CHECK: declare void @f.nosanitize_bounds() #49
+; CHECK: declare void @f.nosanitize_bounds() #50
declare void @f.allockind() allockind("alloc,uninitialized")
-; CHECK: declare void @f.allockind() #50
+; CHECK: declare void @f.allockind() #51
; CHECK: declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
@@ -2051,58 +2053,60 @@ define float @nofpclass_callsites(float %arg) {
ret float %add1
}
-; CHECK: attributes #0 = { alignstack=4 }
-; CHECK: attributes #1 = { alignstack=8 }
-; CHECK: attributes #2 = { alwaysinline }
-; CHECK: attributes #3 = { cold }
-; CHECK: attributes #4 = { convergent }
-; CHECK: attributes #5 = { inlinehint }
-; CHECK: attributes #6 = { jumptable }
-; CHECK: attributes #7 = { minsize }
-; CHECK: attributes #8 = { naked }
-; CHECK: attributes #9 = { nobuiltin }
-; CHECK: attributes #10 = { noduplicate }
-; CHECK: attributes #11 = { noimplicitfloat }
-; CHECK: attributes #12 = { noinline }
-; CHECK: attributes #13 = { nonlazybind }
-; CHECK: attributes #14 = { noredzone }
-; CHECK: attributes #15 = { noreturn }
-; CHECK: attributes #16 = { nounwind }
-; CHECK: attributes #17 = { noinline optnone }
-; CHECK: attributes #18 = { optsize }
-; CHECK: attributes #19 = { memory(none) }
-; CHECK: attributes #20 = { memory(read) }
-; CHECK: attributes #21 = { returns_twice }
-; CHECK: attributes #22 = { safestack }
-; CHECK: attributes #23 = { sanitize_address }
-; CHECK: attributes #24 = { sanitize_memory }
-; CHECK: attributes #25 = { sanitize_thread }
-; CHECK: attributes #26 = { ssp }
-; CHECK: attributes #27 = { sspreq }
-; CHECK: attributes #28 = { sspstrong }
-; CHECK: attributes #29 = { "thunk" }
-; CHECK: attributes #30 = { uwtable }
-; CHECK: attributes #31 = { "cpu"="cortex-a8" }
-; CHECK: attributes #32 = { norecurse }
-; CHECK: attributes #33 = { memory(inaccessiblemem: readwrite) }
-; CHECK: attributes #34 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
-; CHECK: attributes #35 = { nocallback nofree nosync nounwind willreturn memory(none) }
-; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn }
-; CHECK: attributes #37 = { nounwind memory(argmem: read) }
-; CHECK: attributes #38 = { nounwind memory(argmem: readwrite) }
-; CHECK: attributes #39 = { nocallback nofree nosync nounwind willreturn memory(read) }
-; CHECK: attributes #40 = { nocallback nounwind }
-; CHECK: attributes #41 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
-; CHECK: attributes #42 = { memory(write) }
-; CHECK: attributes #43 = { speculatable }
-; CHECK: attributes #44 = { strictfp }
-; CHECK: attributes #45 = { nosanitize_coverage }
-; CHECK: attributes #46 = { disable_sanitizer_instrumentation }
-; CHECK: attributes #47 = { allocsize(0) }
-; CHECK: attributes #48 = { allocsize(1,0) }
-; CHECK: attributes #49 = { nosanitize_bounds }
-; CHECK: attributes #50 = { allockind("alloc,uninitialized") }
-; CHECK: attributes #51 = { builtin }
+; CHECK: attributes #0 = { sanitized_padded_global }
+; CHECK: attributes #1 = { alignstack=4 }
+; CHECK: attributes #2 = { alignstack=8 }
+; CHECK: attributes #3 = { alwaysinline }
+; CHECK: attributes #4 = { cold }
+; CHECK: attributes #5 = { convergent }
+; CHECK: attributes #6 = { inlinehint }
+; CHECK: attributes #7 = { jumptable }
+; CHECK: attributes #8 = { minsize }
+; CHECK: attributes #9 = { naked }
+; CHECK: attributes #10 = { nobuiltin }
+; CHECK: attributes #11 = { noduplicate }
+; CHECK: attributes #12 = { noimplicitfloat }
+; CHECK: attributes #13 = { noinline }
+; CHECK: attributes #14 = { nonlazybind }
+; CHECK: attributes #15 = { noredzone }
+; CHECK: attributes #16 = { noreturn }
+; CHECK: attributes #17 = { nounwind }
+; CHECK: attributes #18 = { noinline optnone }
+; CHECK: attributes #19 = { optsize }
+; CHECK: attributes #20 = { memory(none) }
+; CHECK: attributes #21 = { memory(read) }
+; CHECK: attributes #22 = { returns_twice }
+; CHECK: attributes #23 = { safestack }
+; CHECK: attributes #24 = { sanitize_address }
+; CHECK: attributes #25 = { sanitize_memory }
+; CHECK: attributes #26 = { sanitize_thread }
+; CHECK: attributes #27 = { ssp }
+; CHECK: attributes #28 = { sspreq }
+; CHECK: attributes #29 = { sspstrong }
+; CHECK: attributes #30 = { "thunk" }
+; CHECK: attributes #31 = { uwtable }
+; CHECK: attributes #32 = { "cpu"="cortex-a8" }
+; CHECK: attributes #33 = { norecurse }
+; CHECK: attributes #34 = { memory(inaccessiblemem: readwrite) }
+; CHECK: attributes #35 = { memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #36 = { nocallback nofree nosync nounwind willreturn memory(none) }
+; CHECK: attributes #37 = { nocallback nofree nosync nounwind willreturn }
+; CHECK: attributes #38 = { nounwind memory(argmem: read) }
+; CHECK: attributes #39 = { nounwind memory(argmem: readwrite) }
+; CHECK: attributes #40 = { nocallback nofree nosync nounwind willreturn memory(read) }
+; CHECK: attributes #41 = { nocallback nounwind }
+; CHECK: attributes #42 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
+; CHECK: attributes #43 = { memory(write) }
+; CHECK: attributes #44 = { speculatable }
+; CHECK: attributes #45 = { strictfp }
+; CHECK: attributes #46 = { nosanitize_coverage }
+; CHECK: attributes #47 = { disable_sanitizer_instrumentation }
+; CHECK: attributes #48 = { allocsize(0) }
+; CHECK: attributes #49 = { allocsize(1,0) }
+; CHECK: attributes #50 = { nosanitize_bounds }
+; CHECK: attributes #51 = { allockind("alloc,uninitialized") }
+; CHECK: attributes #52 = { builtin }
+
;; Metadata
More information about the llvm-commits
mailing list