Skip to content

[LangRef][IR] Fix default AS documentation for allocas without explicit AS #135942

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
Apr 22, 2025
Merged
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
10 changes: 6 additions & 4 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11102,9 +11102,8 @@ Overview:

The '``alloca``' instruction allocates memory on the stack frame of the
currently executing function, to be automatically released when this
function returns to its caller. If the address space is not explicitly
specified, the object is allocated in the alloca address space from the
:ref:`datalayout string<langref_datalayout>`.
function returns to its caller. If the address space is not explicitly
specified, the default address space 0 is used.

Arguments:
""""""""""
Expand Down Expand Up @@ -11146,7 +11145,10 @@ which way the stack grows) is not specified.

Note that '``alloca``' outside of the alloca address space from the
:ref:`datalayout string<langref_datalayout>` is meaningful only if the
target has assigned it a semantics.
target has assigned it a semantics. For targets that specify a non-zero alloca
address space in the :ref:`datalayout string<langref_datalayout>`, the alloca
address space needs to be explicitly specified in the instruction if it is to be
used.

If the returned pointer is used by :ref:`llvm.lifetime.start <int_lifestart>`,
the returned object is initially dead.
Expand Down
Loading