[PATCH] D64888: Use the MachineBasicBlock symbol for a callbr target

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 16:34:52 PDT 2019


nickdesaulniers added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:436
+              for (const MachineBasicBlock &MBB : *MF)
+                if (BB == MBB.getBasicBlock()) {
+                  MBB.getSymbol()->print(OS, AP->MAI);
----------------
I'm not sure that either side of this `if` are being tested/covered by your new test in callbr-asm-obj-file.ll.

In particular, the case that worries me is passing the address of a label as an input to `asm goto`.  Consider:

```
asm goto(".quad %l0\n\t.quad %l1" :: "i"(&&baz) :: bar);
        bar:;
        baz:;
```

https://godbolt.org/z/lKa_HD

where 2 blockaddresses are parameters to a callbr, one is the address of a label, one is the jump target list.

I'd be more comfortable signing off on code review if that case was also tested here (and considered in further changes related to `callbr`)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64888





More information about the llvm-commits mailing list