[llvm] inline asm: the instructions are treated opaquely (PR #157080)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 04:45:28 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Ralf Jung (RalfJung)

<details>
<summary>Changes</summary>

This wasn't true until recently, but https://github.com/llvm/llvm-project/issues/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
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

``````````

</details>


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


More information about the llvm-commits mailing list