[PATCH] D129288: [IR] Don't use blockaddresses as callbr arguments

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 13:31:09 PDT 2022


nickdesaulniers added a comment.

In D129288#3636812 <https://reviews.llvm.org/D129288#3636812>, @nikic wrote:

> @nickdesaulniers Why would we need to rewrite the asm string? I'd expect things to stay in the form
>
>   callbr void asm sideeffect "${0:l} ${1:l}", "!i,!i"()
>   to label %1 [label %4, label %4]
>
> where the two inline asm arguments just happen to refer to the same label.

The case you describe looks fine to me, but it also seems different than what @jyknight was describing when he said:

> Can't we remove blocks from the callbr target list in some circumstances? E.g. if we merge two blocks maybe?

You'll notice in my example, I noted that if an operand was removed, say because the two operands were equivalent, the asm string would also need to be updated.  I think for immediates like labels or integer constant expressions, it doesn't make a difference whether the asm operand list has operands merged or not; I don't think that will provide any optimization for the register allocator for instance.


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

https://reviews.llvm.org/D129288



More information about the llvm-commits mailing list