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

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 13:52:15 PDT 2025


================
@@ -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 flags,
+operand constraints, and attributes on the call and surrounding function are
+used to deduce what the expression may do during execution.
----------------
jyknight wrote:

The assembler is part of "LLVM", so we need to be careful when saying what "LLVM" will do. That is, when the integrated assembler is enabled, "LLVM" certainly _does_ look at the contents of the string -- even when writing textual assembly, we parse it, then re-emit with the assembly-writer.

I'd also suggest to shorten this, it doesn't really need to be this verbose I think. Maybe just stick a single sentence on the end of the first paragraph, e.g.:

```
The compiler's understanding of the semantics of the expression comes only from the list of operand constraints and the flags -- not the contents of the template string.
```

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


More information about the llvm-commits mailing list