Skip to content

[debug-info] If one sees a spill with a dbg.addr use, salvageDebugInfo upon it and don't hoist it. #3936

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

Conversation

gottesmm
Copy link

This ensures that if we have a dbg.addr in a coroutine funclet that is on one of
our function arguments, that the dbg.addr is not mapped to undef and also that
later it isn't hoisted to the front of the basic block. Instead it remains at
its original cloned location.

rdar://83957028

Differential Revision: https://reviews.llvm.org/D119576

(cherry picked from commit 19279ff)

Conflicts:
llvm/lib/Transforms/Coroutines/CoroFrame.cpp

The conflict was that the upstream code here seems to handle more cases. I just
did the same transform I did in OSS here (which is not hoisting llvm.dbg.addr).
The rest of the code is unchanged.

@gottesmm
Copy link
Author

@swift-ci test

…o upon it and don't hoist it.

This ensures that if we have a dbg.addr in a coroutine funclet that is on one of
our function arguments, that the dbg.addr is not mapped to undef and also that
later it isn't hoisted to the front of the basic block. Instead it remains at
its original cloned location.

rdar://83957028

Differential Revision: https://reviews.llvm.org/D119576

(cherry picked from commit 19279ff)

Conflicts:
	llvm/lib/Transforms/Coroutines/CoroFrame.cpp

The conflict was that the upstream code here seems to handle more cases. I just
did the same transform I did in OSS here (which is not hoisting llvm.dbg.addr).
The rest of the code is unchanged.
@gottesmm
Copy link
Author

Found a small error where we renamed something upstream. I am fixing it now.

Upstreamed renamed a variable...
@gottesmm gottesmm force-pushed the stable/20211026/coro-dbg.addr branch from 6f86016 to 6bd73c1 Compare February 12, 2022 01:05
@gottesmm
Copy link
Author

@swift-ci test

// Salvage debug info on any dbg.addr that we see. We do not insert them
// into each block where we have a use though.
if (auto *DI = dyn_cast<DbgAddrIntrinsic>(U)) {
coro::salvageDebugInfo(DbgPtrAllocaCache, DI, Shape.ReuseFrameSlot);
Copy link
Author

Choose a reason for hiding this comment

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

ReuseFrameSlot is the variable that was renamed upstream.

@gottesmm gottesmm merged commit ebe9411 into swiftlang:stable/20211026 Feb 12, 2022
@gottesmm gottesmm deleted the stable/20211026/coro-dbg.addr branch February 12, 2022 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants