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

Add support for tagged recorded output #37

Open
nilslice opened this issue May 6, 2022 · 0 comments
Open

Add support for tagged recorded output #37

nilslice opened this issue May 6, 2022 · 0 comments

Comments

@nilslice
Copy link
Contributor

nilslice commented May 6, 2022

A successful, but too fragile approach can be seen in #36. I closed the PR but can use it as a basis to start a conversation about a better option.

Ideally, we can use inkwell to do this properly, but I wasn't able to find a solution in a reasonable amount of time.

The crux of this issue is when adding a new match case for a pointer value in get_qis_function_arguments, to operate on the last argument in a function like:

@tag = internal constant [10 x i8] c"tag_value\00"
; ... 

tail call void @__quantum__rt__result_record_output(%Result* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @tag, i32 0, i32 0))

I'd like to convert the pointer value into an ArrayType so I can use its len method to get the size of the array we want to take from the constant string (which in this case, happens to be the whole string -- but that might not always be the case).

Further, I'm not sure how to access the indices into the array, nor the variable holding the constant.

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

No branches or pull requests

1 participant