Fixes out-of-bound access in generated nested DAG rewriter matching code.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/tools/mlir-tblgen/RewriterGen.cpp | ||
---|---|---|
373 | It might be slightly easier to read this by having a nextOperand++ instead of this numPrevAttrs computation because then it's more like an iterator than arithmetic to understand and the value is only used in one place. |
mlir/test/mlir-tblgen/rewriter-indexing.td | ||
---|---|---|
1 ↗ | (On Diff #307768) | This is an internal detail. Can you run this test through presubmit in the work codebase? We sometimes have to work around lit implementation details and it can take time, so if you find the test failing, I can start to work on the fix in advance. |
39 ↗ | (On Diff #307768) | Does this one gain anything? Ideally we avoid these ifdefs because they make it more confusing. |
mlir/tools/mlir-tblgen/RewriterGen.cpp | ||
383 | Arg. I didn't realize you would have to increment nextOperand in two places anyway. Sorry for making you turn a 2 line change into a different 2 line change. |
Thanks & PTAL
mlir/test/mlir-tblgen/rewriter-indexing.td | ||
---|---|---|
1 ↗ | (On Diff #307768) | Ran through blaze test //third_party/llvm/llvm-project/mlir/test/mlir-tblgen/... and verified test working as expected. |
39 ↗ | (On Diff #307768) | Replaced with just one FileCheck run. |
mlir/tools/mlir-tblgen/RewriterGen.cpp | ||
383 | Ack. It looks slightly better than old version (as there's no confusing subtraction) anyways. |
For the Author property please use the following:
Name: Ray (I-Jui) Sung
Email: ijsung@google.com
Thanks!
It might be slightly easier to read this by having a nextOperand++ instead of this numPrevAttrs computation because then it's more like an iterator than arithmetic to understand and the value is only used in one place.