[Mlir-commits] [mlir] d729f4c - [mlir] Bug fix. Stream must outlive the pass manager.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Nov 19 13:45:57 PST 2021


Author: rdzhabarov
Date: 2021-11-19T21:45:43Z
New Revision: d729f4c38fca91736ef1008660baccbd9d3552f6

URL: https://github.com/llvm/llvm-project/commit/d729f4c38fca91736ef1008660baccbd9d3552f6
DIFF: https://github.com/llvm/llvm-project/commit/d729f4c38fca91736ef1008660baccbd9d3552f6.diff

LOG: [mlir] Bug fix. Stream must outlive the pass manager.

Bug fix. Stream must outlive the pass manager.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D114277

Added: 
    

Modified: 
    mlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp
index f8be171d1f5d..6ae466200608 100644
--- a/mlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToBlob.cpp
@@ -42,10 +42,10 @@ gpu::SerializeToBlobPass::translateToISA(llvm::Module &llvmModule,
   std::string targetISA;
   llvm::raw_string_ostream stream(targetISA);
 
-  llvm::legacy::PassManager codegenPasses;
-
   { // Drop pstream after this to prevent the ISA from being stuck buffering
     llvm::buffer_ostream pstream(stream);
+    llvm::legacy::PassManager codegenPasses;
+
     if (targetMachine.addPassesToEmitFile(codegenPasses, pstream, nullptr,
                                           llvm::CGFT_AssemblyFile))
       return llvm::None;


        


More information about the Mlir-commits mailing list