Skip to content

[DebugInfo] Set all dbg.value intrinsics to be tail-calls #73661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2023
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
4 changes: 3 additions & 1 deletion llvm/lib/IR/DIBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,11 @@ Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V,
DIExpression *Expr,
const DILocation *DL,
Instruction *InsertBefore) {
return insertDbgValueIntrinsic(
Instruction *DVI = insertDbgValueIntrinsic(
V, VarInfo, Expr, DL, InsertBefore ? InsertBefore->getParent() : nullptr,
InsertBefore);
cast<CallInst>(DVI)->setTailCall();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to put this change in DIBuilder::insertDbgIntrinsic, which seems to be the common leaf between all the insertDbgXIntrinsic functions (that's where the IRBuilder::CreateCall call is)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably in the long term (if dbg.values had a long term), however I think that's common between all DbgVariableIntrinsics, thus including dbg.declare too, which I don't want to get into at this stage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems harmless to cover dbg.declares too to me, given

This change has no meaningful effect on the compiler

But I won't insist

return DVI;
}

Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V,
Expand Down