[llvm] [BPF] Allow libcalls behind a feature gate (PR #168442)

Lucas Ste via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 06:15:07 PST 2025


================
@@ -567,9 +568,11 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
   } else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee)) {
     if (StringRef(E->getSymbol()) != BPF_TRAP) {
       Callee = DAG.getTargetExternalSymbol(E->getSymbol(), PtrVT, 0);
-      fail(CLI.DL, DAG,
-           Twine("A call to built-in function '" + StringRef(E->getSymbol()) +
-                 "' is not supported."));
+      if (!AllowBuiltinCalls) {
+        fail(CLI.DL, DAG,
+             Twine("A call to built-in function '" + StringRef(E->getSymbol()) +
+                   "' is not supported."));
+      }
----------------
LucasSte wrote:

Since this is a simple change, I'll add it to the existing commit in this PR and force push it again with the correct title you asked for.

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


More information about the llvm-commits mailing list