[llvm] [BPF] Handle unreachable with a kfunc call (PR #131731)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 10:25:50 PDT 2025


================
@@ -320,6 +320,7 @@ struct BPFMIPreEmitPeephole : public MachineFunctionPass {
   bool adjustBranch();
   bool insertMissingCallerSavedSpills();
   bool removeMayGotoZero();
+  bool addExitAfterUnreachable();
----------------
eddyz87 wrote:

I see, you mean if it is not the last instruction.
Tbh, I don't think this call would ever happen as non-last instruction: `unreachable` is a terminator. Anyways, this is a minor detail, just thought that keeping everything in one place might be simpler.

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


More information about the llvm-commits mailing list