Skip to content

[cherry-pick] [FastISel][DebugInfo] Handle dbg.value targeting allocas (#67187) #7557

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

Conversation

felipepiovezan
Copy link

[FastISel][DebugInfo] Handle dbg.value targeting allocas (#67187)

FastISel currently drops dbg.values targeting allocas. It may seem
surprising that a simple case would fail to be lowered, but dbg.values
targeting allocas are not common; we usually have dbg.declares doing
that, and those are handled by the common code between FastISel and
SelectionDAGISel.

This patch addresses the issue by querying the static alloca map from
FuncInfo. If we have a frame index for it, we create a DBG_VALUE
intrinsic from it.

Cherry-picked from  a41ce98064f6

This also reverts an XFAIL for a test that was failing because of the bug above.

felipepiovezan and others added 2 commits October 3, 2023 09:42
FastISel currently drops dbg.values targeting allocas. It may seem
surprising that a simple case would fail to be lowered, but dbg.values
targeting allocas are not common; we usually have dbg.declares doing
that, and those are handled by the common code between FastISel and
SelectionDAGISel.

This patch addresses the issue by querying the static alloca map from
FuncInfo. If we have a frame index for it, we create a DBG_VALUE
intrinsic from it.

Cherry-picked from  a41ce98
The underlying issue has since been fixed by
llvm#67187
@felipepiovezan
Copy link
Author

@swift-ci please test

@felipepiovezan
Copy link
Author

@swift-ci please test llvm

@felipepiovezan
Copy link
Author

felipepiovezan commented Oct 3, 2023

swift macos failure is https://github.com/apple/swift/pull/68942/files rdar://116407797

@felipepiovezan felipepiovezan merged commit 9cb2117 into swiftlang:stable/20230725 Oct 3, 2023
@felipepiovezan felipepiovezan deleted the felipe/cherry-pick-dbg-value-fix branch October 3, 2023 21:15
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.

1 participant