[clang] [llvm] [ARM, AArch64] Don't put BTI at asm goto branch targets (PR #141562)

Simon Tatham via cfe-commits cfe-commits at lists.llvm.org
Wed May 28 08:20:19 PDT 2025


================
@@ -121,14 +121,21 @@ bool IsValidCloning(const MachineFunction &MF,
       }
       if (PathBB->isMachineBlockAddressTaken()) {
         // Avoid cloning blocks which have their address taken since we can't
-        // rewire branches to those blocks as easily (e.g., branches within
-        // inline assembly).
+        // rewire branches to those blocks as easily.
         WithColor::warning()
             << "block #" << BBID
             << " has its machine block address taken in function "
             << MF.getName() << "\n";
         return false;
       }
+      if (PathBB->isInlineAsmBrIndirectTarget()) {
+        // Similarly for branches to the block within an asm goto.
+        WithColor::warning()
+            << "block #" << BBID
+            << " is a branch target of an 'asm goto' in function "
+            << MF.getName() << "\n";
----------------
statham-arm wrote:

That was surely true already of the "has its machine block address taken" clause just above, which I duplicated to make this version with the changed wording?

Are you asking me to do that unrelated fix as part of this same commit? It seems to me that if it needs fixing at all it should be done separately.

https://github.com/llvm/llvm-project/pull/141562


More information about the cfe-commits mailing list