[llvm] [PowerPC][AIX] Using milicode for memcmp instead of libcall (PR #147093)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 10 03:28:34 PDT 2025
================
@@ -8820,6 +8820,45 @@ static void checkAddrSpaceIsValidForLibcall(const TargetLowering *TLI,
Twine(AS));
}
}
+std::pair<SDValue, SDValue>
+SelectionDAG::getMemcmp(SDValue Chain, const SDLoc &dl, SDValue Mem0,
+ SDValue Mem1, SDValue Size, const CallInst *CI) {
+
+ const char *LibCallName = TLI->getLibcallName(RTLIB::MEMCMP);
+ if (LibCallName == nullptr)
+ return std::make_pair(SDValue(), SDValue());
+ // Emit a library call.
+ TargetLowering::ArgListTy Args;
+ TargetLowering::ArgListEntry Entry;
+ Entry.Ty = PointerType::getUnqual(*getContext());
+ Entry.Node = Mem0;
+ Args.push_back(Entry);
+ Entry.Node = Mem1;
+ Args.push_back(Entry);
+
+ Entry.Ty = getDataLayout().getIntPtrType(*getContext());
+ Entry.Node = Size;
+ Args.push_back(Entry);
+
+ // FIXME: pass in SDLoc
----------------
arsenm wrote:
You have the setDebugLoc below?
https://github.com/llvm/llvm-project/pull/147093
More information about the llvm-commits
mailing list