Open sBobHuang opened 1 month ago
Upon analyzing the process flow, the error appears to involve the operation "arith.divui," which is created at lib/polygeist/Passes/RaiseToAffine.cpp:114. This operation subsequently encounters a problem during evaluation at lib/polygeist/Passes/AffineCFG.cpp:319.
I think lib/polygeist/Passes/AffineCFG.cpp:215 fix
involves a lambda function attempting to promote the current value to a top level to satisfy the condition “It is defined at the top level of 'region' or is its argument.” If promotion is not possible, the function returns nullptr. In this example, the condition for fix at lib/polygeist/Passes/AffineCFG.cpp:326 is not satisfied, but after applying fix, promotion is possible. Therefore, I modified the condition at line lib/polygeist/Passes/AffineCFG.cpp:335 to include DivUIOp, which resolved the issue.
When running my code using cgeist with the --raise-scf-to-affine option, I encountered the following error:
Use the following minimal code example (saved as test.c) that reproduces the error,run the code using
cgeist test.c --raise-scf-to-affine --function=* -S --memref-fullrank -o test.mlir