Skip to content

Commit

Permalink
[LangRef] Use new memory attribute syntax (NFC)
Browse files Browse the repository at this point in the history
Use the memory() spelling in a few places that were using the
old syntax.

The documented attributes for llvm.type.checked.load don't match
the actual attributes, I've raised this here:
https://reviews.llvm.org/D21121#inline-1406792
  • Loading branch information
nikic committed Mar 9, 2023
1 parent 68a07c1 commit 7ed77da
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions llvm/docs/LangRef.rst
Expand Up @@ -2474,8 +2474,8 @@ operand bundle to not miscompile programs containing it.
- The bundle operands for an unknown operand bundle escape in unknown
ways before control is transferred to the callee or invokee.
- Calls and invokes with operand bundles have unknown read / write
effect on the heap on entry and exit (even if the call target is
``readnone`` or ``readonly``), unless they're overridden with
effect on the heap on entry and exit (even if the call target specifies
a ``memory`` attribute), unless they're overridden with
callsite specific attributes.
- An operand bundle at a call site cannot change the implementation
of the called function. Inter-procedural optimizations work as
Expand Down Expand Up @@ -10758,14 +10758,14 @@ to LLVM:
return &s[1].Z.B[5][13];
}

The LLVM code generated by Clang is:
The LLVM code generated by Clang is approximately:

.. code-block:: llvm

%struct.RT = type { i8, [10 x [20 x i32]], i8 }
%struct.ST = type { i32, double, %struct.RT }

define ptr @foo(ptr %s) nounwind uwtable readnone optsize ssp {
define ptr @foo(ptr %s) {
entry:
%arrayidx = getelementptr inbounds %struct.ST, ptr %s, i64 1, i32 2, i32 1, i64 5, i64 13
ret ptr %arrayidx
Expand Down Expand Up @@ -12885,7 +12885,7 @@ Syntax:
declare <pointer type>
@llvm.experimental.gc.get.pointer.base(
<pointer type> readnone nocapture %derived_ptr)
nounwind readnone willreturn
nounwind willreturn memory(none)

Overview:
"""""""""
Expand Down Expand Up @@ -12923,7 +12923,7 @@ Syntax:
declare i64
@llvm.experimental.gc.get.pointer.offset(
<pointer type> readnone nocapture %derived_ptr)
nounwind readnone willreturn
nounwind willreturn memory(none)

Overview:
"""""""""
Expand Down Expand Up @@ -25592,7 +25592,7 @@ Syntax:

::

declare type @llvm.ssa.copy(type %operand) returned(1) readnone
declare type @llvm.ssa.copy(type returned %operand) memory(none)

Arguments:
""""""""""
Expand All @@ -25619,7 +25619,7 @@ Syntax:

::

declare i1 @llvm.type.test(ptr %ptr, metadata %type) nounwind readnone
declare i1 @llvm.type.test(ptr %ptr, metadata %type) nounwind memory(none)


Arguments:
Expand All @@ -25644,7 +25644,7 @@ Syntax:

::

declare {ptr, i1} @llvm.type.checked.load(ptr %ptr, i32 %offset, metadata %type) argmemonly nounwind readonly
declare {ptr, i1} @llvm.type.checked.load(ptr %ptr, i32 %offset, metadata %type) nounwind memory(argmem: read)


Arguments:
Expand Down Expand Up @@ -25734,7 +25734,7 @@ Syntax:

::

declare void @llvm.donothing() nounwind readnone
declare void @llvm.donothing() nounwind memory(none)

Overview:
"""""""""
Expand Down Expand Up @@ -26030,7 +26030,7 @@ Syntax:

::

declare ptr @llvm.load.relative.iN(ptr %ptr, iN %offset) argmemonly nounwind readonly
declare ptr @llvm.load.relative.iN(ptr %ptr, iN %offset) nounwind memory(argmem: read)

Overview:
"""""""""
Expand Down Expand Up @@ -26089,9 +26089,9 @@ This is an overloaded intrinsic. You can use llvm.is.constant with any argument

::

declare i1 @llvm.is.constant.i32(i32 %operand) nounwind readnone
declare i1 @llvm.is.constant.f32(float %operand) nounwind readnone
declare i1 @llvm.is.constant.TYPENAME(TYPE %operand) nounwind readnone
declare i1 @llvm.is.constant.i32(i32 %operand) nounwind memory(none)
declare i1 @llvm.is.constant.f32(float %operand) nounwind memory(none)
declare i1 @llvm.is.constant.TYPENAME(TYPE %operand) nounwind memory(none)

Overview:
"""""""""
Expand Down Expand Up @@ -26134,7 +26134,7 @@ Syntax:

::

declare ptrty llvm.ptrmask(ptrty %ptr, intty %mask) readnone speculatable
declare ptrty llvm.ptrmask(ptrty %ptr, intty %mask) speculatable memory(none)

Arguments:
""""""""""
Expand Down Expand Up @@ -26170,7 +26170,7 @@ Syntax:

::

declare ptr @llvm.threadlocal.address(ptr) nounwind readnone willreturn
declare ptr @llvm.threadlocal.address(ptr) nounwind willreturn memory(none)

Arguments:
""""""""""
Expand Down

0 comments on commit 7ed77da

Please sign in to comment.