-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow Visitor to use CallInst #115
Allow Visitor to use CallInst #115
Conversation
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.
Thanks!
Can you please extend the IR-level tests as well, so we can see it handles IR with a call and a callbr properly, when there is neither a dialect op nor an intrinsic callback registered?
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.
Looks good, some nitpicks inline
* We have encountered IR where it is necessary to transform a CallInst. * This requires a CallInst visitor. Although, a CallInst visitor can be added to the OpMap, it fails to find the CallInst visitor. Instead it gives up when it determines the Call is not an intrinsic or llvm-dialect op. * This change ensures we can find the CallInst visitor.
fdd184a
to
7865204
Compare
I don't understand this part of your request. |
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.
If I understand Thomas correctly, he means using a visitor with a CallInst
in the example here: https://github.com/GPUOpen-Drivers/llvm-dialects/blob/dev/example/ExampleMain.cpp
I think that makes sense
Co-authored-by: Sebastian Neubauer <[email protected]>
At this point, from what I can see, we don't have any Visitor tests... it would help if there was an existing I can work from, I guess I will have to create that... Oh, do you mean, add the CallInst to the example? |
Yeah, I meant that. And then print something to |
I guess its done... I don't really get it what this is doing. |
Ah, you need to add IR and checks here as well (and probably in the other test file): https://github.com/GPUOpen-Drivers/llvm-dialects/blob/dev/test/example/visitor-basic.ll |
Yeah. Sebastian understood correctly, please extend the |
The Example app is invocated during testing. It runs the visitor declared there against a given input LL file and then filechecks against the output there - so it checks if the callbacks are properly invoked. |
Done |
Looks good to me |
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.
Nice!
added to the OpMap, it fails to find the CallInst visitor. Instead it
gives up when it determines the Call is not an intrinsic or
llvm-dialect op.