I’ve recently been building a new IR using MLIR, but it looks like I’m running into some problems.The IR I created is similar to a function call.So I used FlatSymbolRefAttr
(referenced some other code).When I finished writing the parser(because of the complexity of the call form, I chose to implement the parser myself.) for the corresponding op. I got the following error message.
xxxop attribute 'callee' failed to satisfy constraint: flat symbol reference attribute
- I know maybe there is a symbol verification somewhere. So I let
hasVerifier = 1;
and then validate inside, but it still doesn’t help. - Another question. What is the difference between
SymbolRefAttr
andFlatSymbolRefAttr
?
I looked up the relevant information, my understanding is that if it isSymbolRefAttr
, then a function can refer to the symbols in another function, forFlatSymbolRefAttr
, a function can only refer to the symbols in the current function. I don’t know if I understand it right.
I hope someone can help me with my questions.Thanks!