Skip to content

Commit addd14c

Browse files
committed
[MLIR]Fix symbol table lookup
1 parent a18bd6d commit addd14c

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
@@ -426,7 +426,8 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
426426
moduleTranslation.lookupFunction(attr.getValue())) {
427427
call = builder.CreateCall(function, operandsRef, opBundles);
428428
} else {
429-
auto &st = moduleTranslation.symbolTable().getSymbolTable(callOp);
429+
auto module = callOp->getParentOfType<ModuleOp>();
430+
auto &st = moduleTranslation.symbolTable().getSymbolTable(module);
430431
auto alias = st.lookup<AliasOp>(attr.getValue());
431432
if (alias) {
432433
llvm::GlobalValue *callee = moduleTranslation.lookupAlias(alias);
@@ -567,7 +568,8 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
567568
ftype = func->getFunctionType();
568569
callee = func;
569570
} else {
570-
auto &st = moduleTranslation.symbolTable().getSymbolTable(invOp);
571+
auto module = invOp->getParentOfType<ModuleOp>();
572+
auto &st = moduleTranslation.symbolTable().getSymbolTable(module);
571573
auto alias = st.lookup<AliasOp>(attr.getValue());
572574
callee = moduleTranslation.lookupAlias(alias);
573575
ftype = llvm::cast<llvm::FunctionType>(moduleTranslation.convertType(alias.getAliasType()));

0 commit comments

Comments
 (0)