diff --git a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp index a7574a51659e..cdd10137920b 100644 --- a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp @@ -768,13 +768,14 @@ static LogicalResult verify(spirv::ModuleOp moduleOp) { auto &body = op.getRegion(0).front(); llvm::DenseMap, spirv::EntryPointOp> entryPoints; + SymbolTable table(moduleOp); for (auto &op : body) { if (op.getDialect() == dialect) { // For EntryPoint op, check that the function and execution model is not // duplicated in EntryPointOps if (auto entryPointOp = llvm::dyn_cast(op)) { - auto funcOp = moduleOp.lookupSymbol(entryPointOp.fn()); + auto funcOp = table.lookup(entryPointOp.fn()); if (!funcOp) { return entryPointOp.emitError("function '") << entryPointOp.fn() << "' not found in 'spv.module'";