From 663f9e0c9fe4d37ad3b899e8e9d25c16dc1fbfe5 Mon Sep 17 00:00:00 2001 From: Alexander Belyaev Date: Mon, 28 Oct 2019 03:45:00 -0700 Subject: [PATCH] Lookup function declaration in SymbolTable not ModuleOp. PiperOrigin-RevId: 277033167 --- mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h index 4c083f9..d681e4c 100644 --- a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h +++ b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h @@ -22,7 +22,6 @@ #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/StandardOps/Ops.h" #include "mlir/IR/Builders.h" -#include "mlir/IR/Module.h" namespace mlir { @@ -93,10 +92,9 @@ private: Operation *op) const { using LLVM::LLVMFuncOp; - LLVMFuncOp funcOp = - op->getParentOfType().lookupSymbol(funcName); + Operation *funcOp = SymbolTable::lookupNearestSymbolFrom(op, funcName); if (funcOp) - return funcOp; + return llvm::cast(*funcOp); mlir::OpBuilder b(op->getParentOfType()); return b.create(op->getLoc(), funcName, funcType, llvm::None); -- 2.7.4