================
@@ -16303,6 +16303,56 @@ Example:
call void @llvm.call.preallocated.teardown(token %cs)
ret void
+.. _int_asm_constraint_br:
+
+'``llvm.asm.constraint.br``'
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ declare void @llvm.asm.constraint.br()
+
+Overview:
+"""""""""
+
+The '``llvm.asm.constraint.br``' intrinsic is used when an inline asm
+constraint allows for either register or memory, e.g., '``"rm"``'.
+
+Semantics:
+""""""""""
+
+The '``llvm.asm.constraint.br``' allows the back-end to choose the best
+constraint rather than restricting the preferred constraint to one that may
+produce substandard code or cannot be handled by the register allocators.
+
+It can be called only by the '``callbr``' instruction. The default destination
+of the ``callbr`` contains a call to the preferred inline asm, while the single
+indirect destination contains a call to the pessimal inline asm.
+
+Example:
+""""""""
+
+.. code-block:: llvm
+
+ %out = alloca i64, align 8
+ callbr void @llvm.asm.constraint.br()
+ to label %asm.pref.reg [label %asm.pref.mem]
+
+ asm.pref.reg:
+ %0 = tail call i64 asm sideeffect "pushf ; pop $0",
"=rm,~{dirflag},~{fpsr},~{flags}"()
+ br label %asm.merge
+
+ asm.pref.mem:
+ call void asm sideeffect "pushf ; pop $0",
"=*rm,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) %out)
----------------
isanbard wrote:
See
[b411f4f](https://github.com/llvm/llvm-project/pull/197798/commits/b411f4fec779a95e3943f861114ce59e52478414).
https://github.com/llvm/llvm-project/pull/197798
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits