-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add emit_excinfo_store_with_md
for all excinfo
-related store
instructions
#9551
base: main
Are you sure you want to change the base?
Conversation
BTW, can I be upgraded to a collaborator? or can I be given the permission about marking issues and PRs? I can only use this permission to mark the issues and PRs opened by myself. Ha, just asking... |
Oh, if possible, I think this fix should be put in release ASAP, perhaps 0.60? The CI failures are network issues during conda install. |
This release is closed now, unfortunately. I've restarted CI and marked this as needing a review. |
Would suggest to join a dev meeting or office hour and ask about this. |
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.
@dlee992, thanks for the pull request. I gave an initial review and would be good if you could provide a bit more of context on how you're testing this PR.
def emit_excinfo_store_with_md(self, builder, value, excinfo_ptr): | ||
store = builder.store(value, excinfo_ptr) | ||
md = builder.module.add_metadata([ir.IntType(1)(1)]) | ||
store.set_metadata("numba_exception_output", md) | ||
|
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 change this function to only emit the metadata and keep the store out?
def emit_excinfo_store_with_md(self, builder, value, excinfo_ptr): | |
store = builder.store(value, excinfo_ptr) | |
md = builder.module.add_metadata([ir.IntType(1)(1)]) | |
store.set_metadata("numba_exception_output", md) | |
def emit_numba_exception_output_metadata(self, builder, store): | |
md = builder.module.add_metadata([ir.IntType(1)(1)]) | |
store.set_metadata("numba_exception_output", md) |
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.
Yeah, sure, but why we need to keep store
out?
store = builder.store(struct_gv, excptr) | ||
md = builder.module.add_metadata([ir.IntType(1)(1)]) | ||
store.set_metadata("numba_exception_output", md) | ||
self.emit_excinfo_store_with_md(builder, struct_gv, excptr) |
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.
self.emit_excinfo_store_with_md(builder, struct_gv, excptr) | |
store = builder.store(struct_gv, excptr) | |
self.emit_numba_exception_output_metadata(builder, store) |
@@ -712,7 +715,7 @@ def set_dynamic_user_exc(self, builder, exc, exc_args, nb_types, loc=None, | |||
int32_t(len(struct_type))) | |||
for idx, arg in enumerate(exc_fields): | |||
builder.store(arg, builder.gep(excinfo_p, [zero, int32_t(idx)])) | |||
builder.store(excinfo_p, excinfo_pp) | |||
self.emit_excinfo_store_with_md(builder, excinfo_p, excinfo_pp) |
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.
self.emit_excinfo_store_with_md(builder, excinfo_p, excinfo_pp) | |
store = builder.store(excinfo_p, excinfo_pp) | |
self.emit_numba_exception_output_metadata(builder, store) |
@@ -762,12 +765,12 @@ def unset_try_status(self, builder): | |||
# will run normally. | |||
excinfoptr = self._get_excinfo_argument(builder.function) | |||
null = cgutils.get_null_value(excinfoptr.type.pointee) | |||
builder.store(null, excinfoptr) | |||
self.emit_excinfo_store_with_md(builder, null, excinfoptr) |
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.
self.emit_excinfo_store_with_md(builder, null, excinfoptr) | |
store = builder.store(null, excinfoptr) | |
self.emit_numba_exception_output_metadata(builder, store) |
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.
But I wonder if this should be considered a raising block or not, as it is not raising an exception.
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.
Good question! But I didn't know the answer. I just did this conservatively.
|
||
def return_status_propagate(self, builder, status): | ||
trystatus = self.check_try_status(builder) | ||
excptr = self._get_excinfo_argument(builder.function) | ||
builder.store(status.excinfoptr, excptr) | ||
self.emit_excinfo_store_with_md(builder, status.excinfoptr, excptr) |
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.
self.emit_excinfo_store_with_md(builder, status.excinfoptr, excptr) | |
store = builder.store(status.excinfoptr, excptr) | |
self.emit_numba_exception_output_metadata(builder, store) |
Sure, will try. For the test case: |
fixes #9550
This bug is introduced between numba upgraded to llvm14 (#8535) and added the dynamic exception info feature (#8134).