[llvm] [BPF] Support Jump Table (PR #149715)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 20 16:46:39 PDT 2025


================
@@ -181,6 +181,10 @@ bool BPFInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
     if (!isUnpredicatedTerminator(*I))
       break;
 
+    // If a JX insn, we're done.
+    if (I->getOpcode() == BPF::JX)
----------------
yonghong-song wrote:

I guess that
 if (I->getOpcode() == BPF::JX)
     break;
should be really
  if (I->getOpcode() == BPF::JX)
     return true;
But using I->isIndirectBranch() is even better.

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


More information about the llvm-commits mailing list