[PATCH] D81607: BreakCriticalEdges for callbr indirect dests

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 15:56:11 PDT 2020


nickdesaulniers added a comment.

In D81607#2096914 <https://reviews.llvm.org/D81607#2096914>, @efriedma wrote:

> > (Going further, I'd be curious if having a blockaddress not scoped to a function is even generally useful?)
>
> blockaddresses in global variables are required for compatibility with the gcc indirect goto extension.  (Really, we only need them in C static local variables, but that's the same thing in LLVM IR.)


If you're referring to https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html, then the labels still are required to be scoped. ie.

  void* a [] = {&&bar};
  void foo(void) {
      bar:;
  }

is invalid; hence I don't like how `blockaddress` in LLVM don't follow the same scoping restrictions.  (The above idea *can* be expressed in LLVM IR).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81607





More information about the llvm-commits mailing list