[llvm] [PreISelIntrinsicLowering] Expand binary elementwise intrinsics (#193552) (PR #193580)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 24 07:18:35 PDT 2026
================
@@ -810,6 +810,22 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
return lowerUnaryVectorIntrinsicAsLoop(M, CI);
});
break;
+ case Intrinsic::atan2:
+ case Intrinsic::ldexp:
+ case Intrinsic::pow:
+ case Intrinsic::powi:
+ 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());
+ assert(Op != ISD::DELETED_NODE && "unsupported intrinsic");
+ if (!TL->isOperationExpand(Op, EVT::getEVT(Ty)))
----------------
preames wrote:
I'm checking on the others, but there's definitely a problem here. It's a functional one no less. The second argument stays scalar for the vector form, and the code didn't account for that correctly. I'm going to post a change to revert this bit. I swear I tested this end to end, but apparently missed something.
Part of the problem is that we have no codegen tests for any of these on either aarch64 or riscv. I'm going to add them.
https://github.com/llvm/llvm-project/pull/193580
More information about the llvm-commits
mailing list