Skip to content

Revert "[LLVM][rtsan] Add LLVM nosanitize_realtime attribute (#105447)" #106743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2189,10 +2189,6 @@ example:
``nosanitize_coverage``
This attribute indicates that SanitizerCoverage instrumentation is disabled
for this function.
``nosanitize_realtime``
This attribute indicates that the Realtime Sanitizer instrumentation is
disabled for this function.
This attribute is incompatible with the ``sanitize_realtime`` attribute.
``null_pointer_is_valid``
If ``null_pointer_is_valid`` is set, then the ``null`` address
in address-space 0 is considered to be a valid address for memory loads and
Expand Down Expand Up @@ -2319,7 +2315,6 @@ example:
This attribute indicates that RealtimeSanitizer checks
(realtime safety analysis - no allocations, syscalls or exceptions) are enabled
for this function.
This attribute is incompatible with the ``nosanitize_realtime`` attribute.
``speculative_load_hardening``
This attribute indicates that
`Speculative Load Hardening <https://llvm.org/docs/SpeculativeLoadHardening.html>`_
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Bitcode/LLVMBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ enum AttributeKindCodes {
ATTR_KIND_INITIALIZES = 94,
ATTR_KIND_HYBRID_PATCHABLE = 95,
ATTR_KIND_SANITIZE_REALTIME = 96,
ATTR_KIND_NO_SANITIZE_REALTIME = 97,
};

enum ComdatSelectionKindCodes {
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/IR/Attributes.td
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ def NoSanitizeBounds : EnumAttr<"nosanitize_bounds", [FnAttr]>;
/// No SanitizeCoverage instrumentation.
def NoSanitizeCoverage : EnumAttr<"nosanitize_coverage", [FnAttr]>;

/// No SanitizeRealtime instrumentation.
def NoSanitizeRealtime : EnumAttr<"nosanitize_realtime", [FnAttr]>;

/// Null pointer in address space zero is valid.
def NullPointerIsValid : EnumAttr<"null_pointer_is_valid", [FnAttr]>;

Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2093,8 +2093,6 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
return Attribute::NoSanitizeBounds;
case bitc::ATTR_KIND_NO_SANITIZE_COVERAGE:
return Attribute::NoSanitizeCoverage;
case bitc::ATTR_KIND_NO_SANITIZE_REALTIME:
return Attribute::NoSanitizeRealtime;
case bitc::ATTR_KIND_NULL_POINTER_IS_VALID:
return Attribute::NullPointerIsValid;
case bitc::ATTR_KIND_OPTIMIZE_FOR_DEBUGGING:
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,6 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
return bitc::ATTR_KIND_NO_SANITIZE_BOUNDS;
case Attribute::NoSanitizeCoverage:
return bitc::ATTR_KIND_NO_SANITIZE_COVERAGE;
case llvm::Attribute::NoSanitizeRealtime:
return bitc::ATTR_KIND_NO_SANITIZE_REALTIME;
case Attribute::NullPointerIsValid:
return bitc::ATTR_KIND_NULL_POINTER_IS_VALID;
case Attribute::OptimizeForDebugging:
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2223,12 +2223,6 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
"Attributes 'optdebug and optnone' are incompatible!", V);
}

Check(!(Attrs.hasFnAttr(Attribute::SanitizeRealtime) &&
Attrs.hasFnAttr(Attribute::NoSanitizeRealtime)),
"Attributes "
"'sanitize_realtime and nosanitize_realtime' are incompatible!",
V);

if (Attrs.hasFnAttr(Attribute::OptimizeForDebugging)) {
Check(!Attrs.hasFnAttr(Attribute::OptimizeForSize),
"Attributes 'optsize and optdebug' are incompatible!", V);
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/Utils/CodeExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,6 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
case Attribute::NoUnwind:
case Attribute::NoSanitizeBounds:
case Attribute::NoSanitizeCoverage:
case Attribute::NoSanitizeRealtime:
case Attribute::NullPointerIsValid:
case Attribute::OptimizeForDebugging:
case Attribute::OptForFuzzing:
Expand Down
7 changes: 0 additions & 7 deletions llvm/test/Bitcode/attributes.ll
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,6 @@ define void @f92() sanitize_realtime
ret void;
}

; CHECK: define void @f93() #54
define void @f93() nosanitize_realtime
{
ret void;
}

; CHECK: define void @f87() [[FNRETTHUNKEXTERN:#[0-9]+]]
define void @f87() fn_ret_thunk_extern { ret void }

Expand Down Expand Up @@ -612,7 +606,6 @@ define void @initializes(ptr initializes((-4, 0), (4, 8)) %a) {
; CHECK: attributes #51 = { uwtable(sync) }
; CHECK: attributes #52 = { nosanitize_bounds }
; CHECK: attributes #53 = { sanitize_realtime }
; CHECK: attributes #54 = { nosanitize_realtime }
; CHECK: attributes [[FNRETTHUNKEXTERN]] = { fn_ret_thunk_extern }
; CHECK: attributes [[SKIPPROFILE]] = { skipprofile }
; CHECK: attributes [[OPTDEBUG]] = { optdebug }
Expand Down
8 changes: 2 additions & 6 deletions llvm/test/Bitcode/compatibility.ll
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ 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() #54
; CHECK: call void @f.nobuiltin() #53

call fastcc noalias ptr @f.noalias() noinline
; CHECK: call fastcc noalias ptr @f.noalias() #12
Expand Down Expand Up @@ -1992,9 +1992,6 @@ declare void @f.sanitize_numerical_stability() sanitize_numerical_stability
declare void @f.sanitize_realtime() sanitize_realtime
; CHECK: declare void @f.sanitize_realtime() #52

declare void @f.nosanitize_realtime() nosanitize_realtime
; CHECK: declare void @f.nosanitize_realtime() #53

; CHECK: declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))
declare nofpclass(snan) float @nofpclass_snan(float nofpclass(snan))

Expand Down Expand Up @@ -2118,8 +2115,7 @@ define float @nofpclass_callsites(float %arg) {
; CHECK: attributes #50 = { allockind("alloc,uninitialized") }
; CHECK: attributes #51 = { sanitize_numerical_stability }
; CHECK: attributes #52 = { sanitize_realtime }
; CHECK: attributes #53 = { nosanitize_realtime }
; CHECK: attributes #54 = { builtin }
; CHECK: attributes #53 = { builtin }

;; Metadata

Expand Down
9 changes: 0 additions & 9 deletions llvm/test/Verifier/rtsan-attrs.ll

This file was deleted.

Loading