Skip to content

Commit 9c2e755

Browse files
committed
[MLIR]Fix symbol table lookup
1 parent 92ec7cf commit 9c2e755

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
308308
ftype = func->getFunctionType();
309309
callee = func;
310310
} else {
311-
auto &st = moduleTranslation.symbolTable().getSymbolTable(callOp);
311+
auto module = callOp->getParentOfType<ModuleOp>();
312+
auto &st = moduleTranslation.symbolTable().getSymbolTable(module);
312313
auto alias = st.lookup<AliasOp>(attr.getValue());
313314
callee = moduleTranslation.lookupAlias(alias);
314315
ftype = llvm::cast<llvm::FunctionType>(moduleTranslation.convertType(alias.getAliasType()));
@@ -431,7 +432,8 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
431432
ftype = func->getFunctionType();
432433
callee = func;
433434
} else {
434-
auto &st = moduleTranslation.symbolTable().getSymbolTable(invOp);
435+
auto module = invOp->getParentOfType<ModuleOp>();
436+
auto &st = moduleTranslation.symbolTable().getSymbolTable(module);
435437
auto alias = st.lookup<AliasOp>(attr.getValue());
436438
callee = moduleTranslation.lookupAlias(alias);
437439
ftype = llvm::cast<llvm::FunctionType>(moduleTranslation.convertType(alias.getAliasType()));

0 commit comments

Comments
 (0)