[llvm] [BPF] Handle unreachable with a kfunc call (PR #131731)
Yingchi Long via llvm-commits
llvm-commits at lists.llvm.org
Sun May 11 22:53:18 PDT 2025
================
@@ -521,10 +526,12 @@ 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)) {
- 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 (strcmp(E->getSymbol(), BPF_UNREACHABLE) != 0) {
----------------
inclyc wrote:
```suggestion
if (StringRef(E->getSymbol()) != BPF_UNREACHABLE) {
```
https://github.com/llvm/llvm-project/pull/131731
More information about the llvm-commits
mailing list