[Mlir-commits] [mlir] [Func][GPU] Create func::ConstantOp using parents with SymbolTable trait (PR #107748)
Artem Kroviakov
llvmlistbot at llvm.org
Mon Sep 9 01:01:24 PDT 2024
================
@@ -128,7 +128,9 @@ LogicalResult ConstantOp::verify() {
Type type = getType();
// Try to find the referenced function.
- auto fn = (*this)->getParentOfType<ModuleOp>().lookupSymbol<FuncOp>(fnName);
+ SymbolTable symbolTable(
+ (*this)->getParentWithTrait<mlir::OpTrait::SymbolTable>());
+ auto fn = symbolTable.lookup<FuncOp>(fnName);
----------------
akroviakov wrote:
Thanks for your feedback. I have revised the code to use `SymbolUserOpInterface` in `func::ConstantOp`, the resulting `verifySymbolUses()` eliminated the need for building a symbol table for verification.
https://github.com/llvm/llvm-project/pull/107748
More information about the Mlir-commits
mailing list