Skip to content

Commit

Permalink
Fix mismerge in CHERI LLVM SelectionDAG::getMemset
Browse files Browse the repository at this point in the history
The upstream code assumes AS0 for Dst (but curiously not Src), but the
fix for that got lost in CHERI LLVM. Presumably it only affects Morello
LLVM because it has improved libcall detection.

Fixes: 96a072e ("[SelectionDAG] Handle bzero/memset libcalls globally instead of per target")
  • Loading branch information
jrtc27 committed Apr 4, 2024
1 parent 1f40e90 commit b89cd6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7649,14 +7649,14 @@ SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
// If zeroing out and bzero is present, use it.
if (SrcIsZero && BzeroName) {
TargetLowering::ArgListTy Args;
Args.push_back(CreateEntry(Dst, Type::getInt8PtrTy(Ctx)));
Args.push_back(CreateEntry(Dst, Dst.getValueType().getTypeForEVT(Ctx)));
Args.push_back(CreateEntry(Size, DL.getIntPtrType(Ctx)));
CLI.setLibCallee(
TLI->getLibcallCallingConv(RTLIB::BZERO), Type::getVoidTy(Ctx),
getExternalFunctionSymbol(BzeroName), std::move(Args));
} else {
TargetLowering::ArgListTy Args;
Args.push_back(CreateEntry(Dst, Type::getInt8PtrTy(Ctx)));
Args.push_back(CreateEntry(Dst, Dst.getValueType().getTypeForEVT(Ctx)));
Args.push_back(CreateEntry(Src, Src.getValueType().getTypeForEVT(Ctx)));
Args.push_back(CreateEntry(Size, DL.getIntPtrType(Ctx)));
CLI.setLibCallee(
Expand Down

0 comments on commit b89cd6a

Please sign in to comment.