Skip to content

Conversation

RalfJung
Copy link
Contributor

@RalfJung RalfJung commented Sep 5, 2025

This wasn't true until recently, but #156571 got fixed to make it true.

I was not entirely sure where to put this; for now I made it a new paragraph fairly early on in the inline asm docs.

Cc @nikic @jyknight @efriedma-quic

@llvmbot llvmbot added the llvm:ir label Sep 5, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 5, 2025

@llvm/pr-subscribers-llvm-ir

Author: Ralf Jung (RalfJung)

Changes

This wasn't true until recently, but #156571 got fixed to make it true.

I was not entirely sure where to put this; for now I made it a new paragraph fairly early on in the inline asm docs.

Cc @nikic @jyknight @efriedma-quic


Full diff: https://github.com/llvm/llvm-project/pull/157080.diff

1 Files Affected:

  • (modified) llvm/docs/LangRef.rst (+5)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index e64b9343b7622..bdf90c8465d74 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -5229,6 +5229,11 @@ flag that indicates whether or not the inline asm expression has side effects,
 and a flag indicating whether the function containing the asm needs to align its
 stack conservatively.
 
+LLVM will treat the actual instructions entirely opaquely (i.e. no optimizations
+will be performed based on the contents of the template string). Only the
+operand constraints are used to deduce what the expression may do during
+execution.
+
 The template string supports argument substitution of the operands using "``$``"
 followed by a number, to indicate substitution of the given register/memory
 location, as specified by the constraint string. "``${NUM:MODIFIER}``" may also

@RalfJung RalfJung changed the title inline asm: the instructions are treated opaquely [LangRef] inline asm: the instructions are treated opaquely Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants