[llvm] [CodeGen] Add scalarization fallback for multi-result scalable intrinsics (PR #218634)
Mattéo Rizza Murgier via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 01:51:19 PDT 2026
================
@@ -808,6 +809,37 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
return lowerUnaryVectorIntrinsicAsLoop(M, CI);
});
break;
+ case Intrinsic::modf:
+ case Intrinsic::sincos:
+ case Intrinsic::sincospi:
+ Changed |= forEachCall(F, [&](CallInst *CI) {
+ Type *Ty = CI->getArgOperand(0)->getType();
+ if (!TM || !isa<ScalableVectorType>(Ty))
+ return false;
+ const TargetLowering *TL = TM->getSubtargetImpl(F)->getTargetLowering();
+ unsigned Op = TL->IntrinsicIDToISD(F.getIntrinsicID());
----------------
matteo-rm wrote:
`Op` is still needed for the `isOperationExpand` check so it has to be computed either way. Were you suggesting we use `getLibcallForIntrinsic` here? It currently doesn't map vector types so it returns `UNKNOWN_LIBCALL` for these intrinsics; but I can expand it if that's what you had in mind.
https://github.com/llvm/llvm-project/pull/218634
More information about the llvm-commits
mailing list