[llvm] bpf: Support aggregate returns (PR #190894)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 22:49:28 PDT 2026


================
@@ -565,12 +566,13 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
     Callee = DAG.getTargetGlobalAddress(G->getGlobal(), CLI.DL, PtrVT,
                                         G->getOffset(), 0);
   } 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."));
-    }
+    Callee = DAG.getTargetExternalSymbol(E->getSymbol(), PtrVT, 0);
+    StringRef Sym = E->getSymbol();
+    if (Sym != BPF_TRAP && Sym != "__multi3" && Sym != "__divti3" &&
+        Sym != "__modti3" && Sym != "__udivti3" && Sym != "__umodti3")
----------------
yonghong-song wrote:

Since we SHL_PARTS for Custom and in LowerShiftParts(), it didn't use any libcall functions (Expand). Maybe the above. checking for "__multi3" etc. is not necessary.

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


More information about the llvm-commits mailing list