[PATCH] D114329: [asm] Allow labels as operands in intel asm syntax

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 08:50:05 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7c2d51474aae: [asm] Allow labels as operands in intel asm syntax (authored by thakis).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114329/new/

https://reviews.llvm.org/D114329

Files:
  llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
  llvm/test/CodeGen/X86/asm-block-labels.ll


Index: llvm/test/CodeGen/X86/asm-block-labels.ll
===================================================================
--- llvm/test/CodeGen/X86/asm-block-labels.ll
+++ llvm/test/CodeGen/X86/asm-block-labels.ll
@@ -39,3 +39,12 @@
 return:		; preds = %"LASM$foo"
 	ret void
 }
+
+define void @quux() {
+entry:
+	call void asm sideeffect inteldialect "brl ${0:l}", "X,~{dirflag},~{fpsr},~{flags},~{memory}"( label %"LASM$foo" )
+	br label %"LASM$foo"
+
+"LASM$foo":		; preds = %entry
+	ret void
+}
Index: llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+++ llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
@@ -281,6 +281,9 @@
             MCSymbol *Sym = AP->GetBlockAddressSymbol(BA);
             Sym->print(OS, AP->MAI);
             MMI->getContext().registerInlineAsmLabel(Sym);
+          } else if (MI->getOperand(OpNo).isMBB()) {
+            const MCSymbol *Sym = MI->getOperand(OpNo).getMBB()->getSymbol();
+            Sym->print(OS, AP->MAI);
           } else if (InlineAsm::isMemKind(OpFlags)) {
             Error = AP->PrintAsmMemoryOperand(
                 MI, OpNo, Modifier[0] ? Modifier : nullptr, OS);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114329.388933.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211122/c22ae509/attachment.bin>


More information about the llvm-commits mailing list