onnx-mlir
onnx-mlir copied to clipboard
issues with mlir2FileCheck.py
This is a very useful tool for lit test. But there are several issues with the tool:
- Arguments in block. They should be definition of a symbol, not a reference.
- name for negative constant. VAR_cvalue is used for constant Value. When the value is negative, VAR_c-* is not a legal name.
- name attribute for constant. We added a name attribute for constant, which contains the value of a global counter. As a result, we cannot use the mlir2FileCheck.py on one test case. My solution is to manually change
name={{.*}}
.
Another issue, not rooted from mlir2FileCheck.py, is the handling of DAG. The check tool is not power enough enough to handle the DAG with different order. We have to put the IR creation code in a linear sequence. For example, instead of c = (create a) + (create b)
, we have to write v1 = create a, v2 = create b, c = a+b
Can you give me a small example for 1, 2, and 3 (the mlir file), then I can try to address these suggestions.