Skip to content

Commit

Permalink
New attribute IntrReadInaccessibleMemOnly; use IntrInaccessibleMemOnl…
Browse files Browse the repository at this point in the history
…y for runtime start and stop
  • Loading branch information
VoxSciurorum committed Aug 26, 2024
1 parent 66a8741 commit d6eec01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions llvm/include/llvm/IR/Intrinsics.td
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def IntrArgMemOnly : IntrinsicProperty;
// accessible by the module being compiled. This is a weaker form of IntrNoMem.
def IntrInaccessibleMemOnly : IntrinsicProperty;

def IntrReadInaccessibleMemOnly : IntrinsicProperty;

// IntrInaccessibleMemOrArgMemOnly -- This intrinsic only accesses memory that
// its pointer-typed arguments point to or memory that is not accessible
// by the module being compiled. This is a weaker form of IntrArgMemOnly.
Expand Down Expand Up @@ -1719,10 +1721,10 @@ def int_syncregion_start
: Intrinsic<[llvm_token_ty], [], [IntrArgMemOnly, IntrWillReturn]>;

def int_tapir_runtime_start
: Intrinsic<[llvm_token_ty], [], [IntrArgMemOnly, IntrWillReturn]>;
: Intrinsic<[llvm_token_ty], [], [IntrInaccessibleMemOnly, IntrWillReturn]>;

def int_tapir_runtime_end
: Intrinsic<[], [llvm_token_ty], [IntrArgMemOnly, IntrWillReturn]>;
: Intrinsic<[], [llvm_token_ty], [IntrInaccessibleMemOnly, IntrWillReturn]>;

// Intrinsics for taskframes.

Expand Down Expand Up @@ -1769,14 +1771,15 @@ def int_tapir_loop_grainsize
// lowering transforms this intrinsic into ordinary frameaddress
// intrinsics.
def int_task_frameaddress
: Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], [IntrWillReturn]>;
: Intrinsic<[llvm_ptr_ty], [llvm_i32_ty],
[IntrReadInaccessibleMemOnly,IntrWillReturn]>;

// Ideally the types would be [llvm_anyptr_ty], [LLVMMatchType<0>]
// but that does not work, so rely on the front end to insert bitcasts.
def int_hyper_lookup
: Intrinsic<[llvm_ptr_ty],
[llvm_ptr_ty, llvm_anyint_ty, llvm_ptr_ty, llvm_ptr_ty], [
IntrWillReturn, IntrReadMem, IntrInaccessibleMemOnly,
IntrWillReturn, IntrReadInaccessibleMemOnly,
IntrStrandPure, IntrHyperView, IntrInjective
]>;

Expand Down
2 changes: 2 additions & 0 deletions llvm/utils/TableGen/CodeGenIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ void CodeGenIntrinsic::setProperty(Record *R) {
ME &= MemoryEffects::argMemOnly();
else if (R->getName() == "IntrInaccessibleMemOnly")
ME &= MemoryEffects::inaccessibleMemOnly();
else if (R->getName() == "IntrReadInaccessibleMemOnly")
ME &= MemoryEffects::inaccessibleMemOnly(ModRefInfo::Ref);
else if (R->getName() == "IntrInaccessibleMemOrArgMemOnly")
ME &= MemoryEffects::inaccessibleOrArgMemOnly();
else if (R->getName() == "Commutative")
Expand Down

0 comments on commit d6eec01

Please sign in to comment.