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

Hongyu Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 24 02:10:39 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)
----------------
XChy wrote:

Yes, the inlineasm br should be near the end in most cases.

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


More information about the llvm-commits mailing list