[PATCH] D152221: Avoid cross-section branches in AArch64 inline asm

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 13:15:01 PDT 2023


efriedma added a comment.

gcc documentation explicitly states "asm statements may not perform jumps into other asm statements".  I don't think there's an equivalent statement in LangRef, but there are obvious reasons we have to restrict it: even if it appears to work in simple cases, in general it will blow up because the compiler assumes control can't flow that way.  For example, the compiler can hoist and sink operations across the inline asm.  (This is fundamental to the way we currently represent inline asm in LLVM IR.)

So if a user has code like your example, they should fix their code; it's a ticking time bomb with or without function splitting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152221



More information about the llvm-commits mailing list