summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Conversion/GPUCommon
diff options
context:
space:
mode:
authorAlexander Belyaev <pifon@google.com>2019-10-28 03:45:00 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-28 03:45:53 -0700
commit663f9e0c9fe4d37ad3b899e8e9d25c16dc1fbfe5 (patch)
tree14ed889b9e566d9d992f091e9c6c93a6c8b93274 /mlir/lib/Conversion/GPUCommon
parent780a108d31d798d4cc3c3373dfd26108a613ae0f (diff)
downloadbcm5719-llvm-663f9e0c9fe4d37ad3b899e8e9d25c16dc1fbfe5.tar.gz
bcm5719-llvm-663f9e0c9fe4d37ad3b899e8e9d25c16dc1fbfe5.zip
Lookup function declaration in SymbolTable not ModuleOp.
PiperOrigin-RevId: 277033167
Diffstat (limited to 'mlir/lib/Conversion/GPUCommon')
-rw-r--r--mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h
index 4c083f98230..d681e4c86ea 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<ModuleOp>().lookupSymbol<LLVMFuncOp>(funcName);
+ Operation *funcOp = SymbolTable::lookupNearestSymbolFrom(op, funcName);
if (funcOp)
- return funcOp;
+ return llvm::cast<LLVMFuncOp>(*funcOp);
mlir::OpBuilder b(op->getParentOfType<LLVMFuncOp>());
return b.create<LLVMFuncOp>(op->getLoc(), funcName, funcType, llvm::None);
OpenPOWER on IntegriCloud