[llvm] inline asm: the instructions are treated opaquely (PR #157080)
Ralf Jung via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 5 04:44:52 PDT 2025
https://github.com/RalfJung created https://github.com/llvm/llvm-project/pull/157080
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
>From d9137b4019217571731c2870e122637226fba966 Mon Sep 17 00:00:00 2001
From: Ralf Jung <post at ralfj.de>
Date: Fri, 5 Sep 2025 13:42:56 +0200
Subject: [PATCH] inline asm: the instructions are treated opaquely
---
llvm/docs/LangRef.rst | 5 +++++
1 file changed, 5 insertions(+)
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
More information about the llvm-commits
mailing list