[llvm] DAG: Gracefully diagnose missing lrint/llrint/lround/llround libcall (PR #215032)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 01:41:38 PDT 2026


================
@@ -4570,11 +4570,21 @@ void DAGTypeLegalizer::ExpandIntRes_XROUND_XRINT(SDNode *N, SDValue &Lo,
 
   EVT RetVT = N->getValueType(0);
 
+  RTLIB::LibcallImpl LCImpl = DAG.getLibcalls().getLibcallImpl(LC);
+  if (LCImpl == RTLIB::Unsupported) {
+    DAG.getContext()->emitError(Twine("no libcall available for ") +
----------------
rovka wrote:

Actually, now that I think about it, can we just push this check into TLI.makeLibCall? It can just call getLibcallImpl early on, check, error, return poison if need be... And the callers probably wouldn't need any changes at all.

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


More information about the llvm-commits mailing list