================
@@ -3531,10 +3568,17 @@ mlir::LogicalResult 
CIRToLLVMGlobalOpLowering::matchAndRewrite(
         if (std::optional<mlir::Attribute> bulkInit = lowerConstArrayAttr(
                 constArr, symbolTables, typeConverter, modOp)) {
           mlir::SymbolRefAttr comdatAttr = getComdatAttr(op, rewriter);
-          rewriter.replaceOpWithNewOp<mlir::LLVM::GlobalOp>(
+          // The driver does not invalidate the cached symbol table, so
+          // maintain it explicitly: drop the old entry before replacement
+          // and register the new op after.
+          symbolTables.getSymbolTable(modOp).remove(op);
----------------
xlauko wrote:

The remove / replace / setAttr / insert sequence is repeated here, at 3600 and 
at 3633. Could it go into a helper?

https://github.com/llvm/llvm-project/pull/238698
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to