cornell-zhang/hcl-dialect

[Backend][LLVM] Python Execution Engine Returns Different Results than `hcl-opt`

Closed this issue · 1 comments

This thread documents an issue with MLIR's execution engine. For some error test cases, running the MLIR assembly with hcl-opt gives correct result, but creating the execution engine from Python and invoke it still returns wrong results.

This issue is caused by automatic optimizations during ExecutionEngine creation. The default optimization level is 2. In the test_compute_pack_unpack.py::test_unpack case, we observed that store operations to a 1-bit memref were erased after these automatic optimizations. After turning off the optimizations, we get correct results on the Python side.

Fixed in the HeteroCL frontend repo by this commit: cornell-zhang/heterocl@5581f2e