[PATCH] D124697: Distinguish between different forms of "address-taken" MachineBasicBlocks

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 7 02:52:17 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:3481
 
-    // MBBs can have their address taken as part of CodeGen without having
-    // their corresponding BB's address taken in IR
-    if (BB && BB->hasAddressTaken())
-      for (MCSymbol *Sym : getAddrLabelSymbolToEmit(BB))
-        OutStreamer->emitLabel(Sym);
+    assert(BB && BB->hasAddressTaken() && "Missing BB");
+    for (MCSymbol *Sym : getAddrLabelSymbolToEmit(BB))
----------------
I don't like this hard requirement on the IR. CodeGen passes should try to avoid depending on the block being present (In particular llvm-reduce is now stripping out IR block references).


================
Comment at: llvm/test/tools/llvm-reduce/mir/preserve-block-info.mir:11
 
-# RESULT: bb.1 (address-taken, align 8):
+# RESULT: bb.1 (blockaddress-target, align 8):
 # RESULT: bb.2 (landing-pad, align 16):
----------------
Probably should add another case and check for the second flavor


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124697



More information about the llvm-commits mailing list