[llvm] [PHIElimination] Ensure correct copy emission for `INLINEASM_BR` indirect targets (PR #173396)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 24 02:15:45 PST 2025


================
@@ -13,6 +13,19 @@
 
 using namespace llvm;
 
+// Returns true if MBB contains an INLINEASM_BR instruction that may
+// branch to SuccMBB, requiring specialized copy placement.
+static bool hasInlineAsmBrToSuccessor(MachineBasicBlock *MBB,
+                                      MachineBasicBlock *SuccMBB) {
+  if (!SuccMBB->isInlineAsmBrIndirectTarget())
+    return false;
+
+  for (const MachineInstr &MI : *MBB)
+    if (MI.getOpcode() == TargetOpcode::INLINEASM_BR)
+      return true;
----------------
arsenm wrote:

Break at end of terminators 

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


More information about the llvm-commits mailing list