================ @@ -359,18 +359,21 @@ class OpLowerer { return lowerToBindAndAnnotateHandle(F); } - Error replaceSplitDoubleCallUsages(CallInst *Intrin, CallInst *Op) { + Error replaceExtractElementTypeOfCallUsages(CallInst *Intrin, CallInst *Op) { for (Use &U : make_early_inc_range(Intrin->uses())) { if (auto *EVI = dyn_cast<ExtractValueInst>(U.getUser())) { if (EVI->getNumIndices() != 1) - return createStringError(std::errc::invalid_argument, - "Splitdouble has only 2 elements"); + return createStringError( ---------------- Icohedron wrote:
To be as generic as possible, I could replace the entire function so that it reads: ```c++ Error replaceExtractElementTypeOfCallUsages(CallInst *Intrin, CallInst *Op) { for (Use &U : make_early_inc_range(Intrin->uses())) { U.set(Op); } Intrin->eraseFromParent(); return Error::success(); } ``` This function would just replace all uses of the intrinsic with one to match the new named struct op return type. The function name would need to be changed, or it could be inlined into `replaceFunctionWithNamedStructOp`, since that is the only user of `replaceExtractElementTypeOfCallUsages`. https://github.com/llvm/llvm-project/pull/125319 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits