Add verifier for gpu.alloc op to verify if the dimension operand counts and symbol operand counts are same as their memref counterparts.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM - thanks. Commit summary is empty. (You can just copy-paste the commit title into the summary here.)
LGTM - thanks. Commit summary is empty. (You can just copy-paste the commit title into the summary here.)
In git that means just repeating twice the same line in the commit message, am I missing something?
I rather have a description of what the verified is implementing in the description.
Yes, that would be better, but in some cases, the title itself is a valid summary. Structurally, I think it isn't good to leave the summary empty (for whatever automation may be done in the future on git commits for example) -- the title and summary are distinct things. Duplicating the title into the summary itself is better than no summary I think even if it's adding zero information.
I’ve never seen a title duplicated in a git commit message, do you have any reference recommending this?
Hello Mehdi,
I have updated the commit summary, could you please check if it is okay?
Thanks,
Akshay
Add verifier for gpu.alloc op to verify if the dimension operand counts and symbol operand counts are same as their memref counterparts.
Thanks for adding this. Could this rather reuse the logic from verifyAllocLike from the memref operations? It is the same logic but it would need to be exposed to other dialect.
It's not clear to me too where this should be exposed from. Also, we can't really reuse everything since memref.alloc/alloca are single-result ops while this one has two results. So things would still spill over unfortunately at both places.
This dropped off my review queue somehow. You are right, reuse seems difficult and might not be worth it after all.
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
1177 | The more common pattern is to make this a method AllocOp::verify and then have let hasVerifier = 1; in the td file. |
mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | ||
---|---|---|
1177 | Looks like I landed this before I saw this comment. @akshaybaviskar could you please address this in a follow-up NFC revision? |
Note that while this was being iterated upon, the verifier field that this uses has been deprecated. Please send a follow-up updating it. https://discourse.llvm.org/t/psa-ods-op-verifier-field-is-being-removed/59714
The more common pattern is to make this a method AllocOp::verify and then have let hasVerifier = 1; in the td file.