File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
llvm/lib/CodeGen/SelectionDAG Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2381,8 +2381,19 @@ SelectionDAGLegalize::ExpandDivRemLibCall(SDNode *Node,
23812381 Entry.IsZExt = !isSigned;
23822382 Args.push_back (Entry);
23832383
2384- SDValue Callee = DAG.getExternalSymbol (TLI.getLibcallName (LC),
2385- TLI.getPointerTy (DAG.getDataLayout ()));
2384+ RTLIB::LibcallImpl LibcallImpl = TLI.getLibcallImpl (LC);
2385+ if (LibcallImpl == RTLIB::Unsupported) {
2386+ DAG.getContext ()->emitError (Twine (" no libcall available for " ) +
2387+ Node->getOperationName (&DAG));
2388+ SDValue Poison = DAG.getPOISON (RetVT);
2389+ Results.push_back (Poison);
2390+ Results.push_back (Poison);
2391+ return ;
2392+ }
2393+
2394+ SDValue Callee =
2395+ DAG.getExternalSymbol (TLI.getLibcallImplName (LibcallImpl).data (),
2396+ TLI.getPointerTy (DAG.getDataLayout ()));
23862397
23872398 SDLoc dl (Node);
23882399 TargetLowering::CallLoweringInfo CLI (DAG);
You can’t perform that action at this time.
0 commit comments