Skip to content
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

__enzyme_allocation_like fails to detect null pointer argument index #1321

Closed
pengmai opened this issue Jul 7, 2023 · 1 comment · Fixed by #1322
Closed

__enzyme_allocation_like fails to detect null pointer argument index #1321

pengmai opened this issue Jul 7, 2023 · 1 comment · Fixed by #1322

Comments

@pengmai
Copy link
Member

pengmai commented Jul 7, 2023

Context: When registering a custom allocator via __enzyme_allocation_like as a global array, the second element is the index of the argument for the size of the memory allocation. This element must be an integer casted to a pointer.

If this index is 0, many frontends (including clang and mlir-translate) will emit a ConstantPointerNull instead of a ConstantInt in the array. This causes preserve-nvvm to fail to detect the metadata, which triggers a crash.

Is there a known workaround? If not, I believe the fix should be pretty simple and I'm happy to submit a PR.

@wsmoses
Copy link
Member

wsmoses commented Jul 7, 2023

Not that I'm aware of, fix is welcome!

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 a pull request may close this issue.

2 participants