-
Notifications
You must be signed in to change notification settings - Fork 345
Add new llvm.dbg.coroframe_entry intrinsic and support for it in the Corosplitter pass #11245
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
base: stable/21.x
Are you sure you want to change the base?
Conversation
642f1c0
to
adb35f3
Compare
3f4004b
to
2d3a5cb
Compare
LLVM_ABI TinyPtrVector<DbgCoroFrameEntryInst *> | ||
findDbgCoroFrameEntrys(Value *V); | ||
/// As above, for DVRCoroFrameEntrys. | ||
LLVM_ABI TinyPtrVector<DbgVariableRecord *> findDVRCoroFrameEntrys(Value *V); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should (upstream) replace this with one API that lets you pass a kind
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a FIXME comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also put some placeholder comments into LangRef so we don't forget to update that when upstreaming?
0055330
to
b09a8ac
Compare
For swift async code, we need to use a debug intrinsic that behaves like an llvm.dbg.declare but can take any location type rather than just a pointer or integer. To solve this, a new debug instrinsic called llvm.dbg.coroframe_entry has been created, which behaves exactly like an llvm.dbg.declare but can take non pointer and integer location types. rdar://157299589 rdar://157509307
Make sure the CoroSplitter pass correctly handles llvm.dbg.coroframe_entry intrinsics. Also, convert them to llvm.dbg.declares so that any subsquent passes do not need to be amended to support the llvm.dbg.coroframe_entry intrinsic. rdar://157299589 rdar://157509307
b09a8ac
to
e5b3fa3
Compare
For swift async debug info, we create llvm.dbg.declare that contain
locations which may not be a pointer or int. This is fine, because the
CoroSplitter pass fixes up those llvm.dbg.declares later.
However, with a recent change to the LLVM Verifier, there is a check
that asserts if there is a llvm.dbg.declare with a location other than
a pointer or an int.
To workaround the problem, we created a new llvm.dbg.coroframe_entry
intrinsic that doesn't have the same restrictions as llvm.dbg.declare, it
can take non pointer and integer location types.
We also need to update the Corosplitter pass to correctly handle the
new llvm.dbg.coroframe_entry intrinsic, while making sure that it is
converted to a llvm.dbg.declare after the CoroSplitter has run, so that
subsequent passes do not have to be updated to handle the
llvm.dbg.coroframe_entry intrinsic.
This patch achieves both of the above goals.
rdar://157299589
rdar://157509307