Add a verifier for the loop op in the OpenACC dialect. Check basic restriction
from 2.9 Loop construct from the OpenACC 3.0 specs.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td | ||
---|---|---|
257–270 | Tablegen generates accessors for all attributes using their names, with proper value casting, loopAuto(), loopIndependent() and loopSeq() in this case. Please use those instead of reimplementing them. | |
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp | ||
673 | don't add trailing dots to error messages | |
676 | Nit: terminate sentences with a dot. | |
683 | This can be expressed as a trait in tablegen: either SingleBlockImplicitTerminator if you also want the terminator kind to be verified and automatically added by the parser, or SizedRegion<1> if you only want single-block regions. | |
mlir/test/Dialect/OpenACC/ops.mlir | ||
199–201 | These changes look irrelevant to the commit. |
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp | ||
---|---|---|
683 | I would like to check that there is something else than the terminator. |
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp | ||
---|---|---|
683 | Then use SizedRegion<1> to check for a single block, and then write the proper check for more operations. |
Address review comments
mlir/test/Dialect/OpenACC/ops.mlir | ||
---|---|---|
199–201 | With the new verifier empty body will trigger an error therefore I added smith in. |
mlir/test/Dialect/OpenACC/ops.mlir | ||
---|---|---|
199–201 | I'd just add "some.op"() : () -> (), which is shorter and does not imply there is some semantics associated with SCF fors being present under acc.loop. | |
247 | Please don't tests for irrelevant things such as scf.for syntax. It has absolutely no connection to the acc dialect and just makes it more painful for anybody willing to change scf.for itself. |
Tablegen generates accessors for all attributes using their names, with proper value casting, loopAuto(), loopIndependent() and loopSeq() in this case. Please use those instead of reimplementing them.