Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions llvm/lib/Target/AArch64/AArch64StackTagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,15 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
IRBuilder<> IRB(Info.AI->getNextNode());
Function *TagP = Intrinsic::getDeclaration(
F->getParent(), Intrinsic::aarch64_tagp, {Info.AI->getType()});
Instruction *TagPCall =
IRB.CreateCall(TagP, {Constant::getNullValue(Info.AI->getType()), Base,
ConstantInt::get(IRB.getInt64Ty(), Tag)});
Instruction *TagPCall = IRB.CreateCall(
TagP, {Info.AI, Base, ConstantInt::get(IRB.getInt64Ty(), Tag)});
if (Info.AI->hasName())
TagPCall->setName(Info.AI->getName() + ".tag");
// Does not replace metadata, so we don't have to handle DbgVariableRecords.
Info.AI->replaceUsesWithIf(TagPCall, [&](const Use &U) {
return !memtag::isLifetimeIntrinsic(U.getUser());
return !memtag::isLifetimeIntrinsic(U.getUser()) &&
U.getUser() != TagPCall;
});
TagPCall->setOperand(0, Info.AI);

// Calls to functions that may return twice (e.g. setjmp) confuse the
// postdominator analysis, and will leave us to keep memory tagged after
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.