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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 10:05:15 PDT 2022


efriedma added a comment.

The problem that I spotted that led me to actually submitting this patch is the use of hasAddressTaken() in AsmPrinter::emitBasicBlockStart.  It's ambiguous: in general, there could be mulitple "address-taken" MachineBasicBlocks that map to a given BasicBlock.  (Maybe there's some other way to disambiguate, but this seems like the simplest.)

There are other reasons it might make sense to have this separation, anyway: we have robust support for "orphaned" blockaddresses (which don't actually map to any MachineBasicBlock), but for target-specific uses of setHasAddressTaken(), we probably end up with a use-after-free.  So some places in the code generator might want to check for a "target-specific" address-taken, but not uses of blockaddress.


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