Skip to content
Closed
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
6 changes: 0 additions & 6 deletions clang/lib/CodeGen/CGCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,12 +2408,6 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
FuncAttrs.addAttribute(llvm::Attribute::NoReturn);
NBA = Fn->getAttr<NoBuiltinAttr>();
}

for (const FunctionEffectWithCondition &Fe : Fn->getFunctionEffects()) {
if (Fe.Effect.kind() == FunctionEffect::Kind::NonBlocking) {
FuncAttrs.addAttribute(llvm::Attribute::NonBlocking);
}
}
}

if (isa<FunctionDecl>(TargetDecl) || isa<VarDecl>(TargetDecl)) {
Expand Down
16 changes: 12 additions & 4 deletions clang/lib/CodeGen/CodeGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,16 +1612,24 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
}

if (SanOpts.has(SanitizerKind::Realtime)) {
if (Fn->hasFnAttribute(llvm::Attribute::NonBlocking))
InsertCallAtFunctionEntryPoint(Fn, "__rtsan_realtime_enter");
for (const FunctionEffectWithCondition &Fe : FD->getFunctionEffects()) {
if (Fe.Effect.kind() == FunctionEffect::Kind::NonBlocking) {
InsertCallAtFunctionEntryPoint(Fn, "__rtsan_realtime_enter");
break;
}
}
}

// Emit the standard function epilogue.
FinishFunction(BodyRange.getEnd());

if (SanOpts.has(SanitizerKind::Realtime)) {
if (Fn->hasFnAttribute(llvm::Attribute::NonBlocking))
InsertCallAtAllFunctionExitPoints(Fn, "__rtsan_realtime_exit");
for (const FunctionEffectWithCondition &Fe : FD->getFunctionEffects()) {
if (Fe.Effect.kind() == FunctionEffect::Kind::NonBlocking) {
InsertCallAtAllFunctionExitPoints(Fn, "__rtsan_realtime_exit");
break;
}
}
}

// If we haven't marked the function nothrow through other means, do
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 @@ -758,7 +758,6 @@ enum AttributeKindCodes {
ATTR_KIND_SANITIZE_NUMERICAL_STABILITY = 93,
ATTR_KIND_INITIALIZES = 94,
ATTR_KIND_HYBRID_PATCHABLE = 95,
ATTR_KIND_NONBLOCKING = 96,
};

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 @@ -239,9 +239,6 @@ def ReadNone : EnumAttr<"readnone", [ParamAttr]>;
/// Function only reads from memory.
def ReadOnly : EnumAttr<"readonly", [ParamAttr]>;

/// Function is marked to be non-blocking
def NonBlocking : EnumAttr<"nonblocking", [FnAttr]>;

/// Return value is always equal to this argument.
def Returned : EnumAttr<"returned", [ParamAttr]>;

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 @@ -2109,8 +2109,6 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
return Attribute::ReadOnly;
case bitc::ATTR_KIND_RETURNED:
return Attribute::Returned;
case bitc::ATTR_KIND_NONBLOCKING:
return Attribute::NonBlocking;
case bitc::ATTR_KIND_RETURNS_TWICE:
return Attribute::ReturnsTwice;
case bitc::ATTR_KIND_S_EXT:
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 @@ -805,8 +805,6 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
return bitc::ATTR_KIND_OPTIMIZE_FOR_SIZE;
case Attribute::OptimizeNone:
return bitc::ATTR_KIND_OPTIMIZE_NONE;
case Attribute::NonBlocking:
return bitc::ATTR_KIND_NONBLOCKING;
case Attribute::ReadNone:
return bitc::ATTR_KIND_READ_NONE;
case Attribute::ReadOnly:
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 @@ -970,7 +970,6 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
case Attribute::MustProgress:
case Attribute::NoProfile:
case Attribute::SkipProfile:
case Attribute::NonBlocking:
break;
// These attributes cannot be applied to functions.
case Attribute::Alignment:
Expand Down