Open HahaLan97 opened 2 weeks ago
The commit is an incorrect work-around for a specific usage for now.
This error is raised by the SSACFG verifier and make the region a GraphRegion
will solve this. However, we don't want this for OperatorOp
or ProcessOp
. for this usage, we need something from the last loop, we need to think about how to handle the state. And how the lowering will look like.
ProcessOp
, the state should be easily handled as iter_args
as in scf ops, which should only make sense in LoopOp
.OperatorOp
, the state could be a new block argument. And an optional initialization region to yield trivial constants.
In CIRCT, the following code is legal:
As you can see that the addition takes the result as the one operand as well, which is a quite common impl of MAC operation. However, in
mlir/lib/IR/Verifier.cpp
, this is not allowed, which means if I write:This is illegal. To support this, I think I have to make the region a GraphRegion. I'm not so sure if we should do this if we want to allow ops like
scf.if
in the region, what you guys think? @Feliix42 @KFAFSP