[llvm-branch-commits] [mlir] 6f62380 - [mlir] Bug fix. Stream must outlive the pass manager.

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 19 13:36:13 PST 2021


Author: rdzhabarov
Date: 2021-11-19T21:30:43Z
New Revision: 6f62380b2b5b20f16ea8365718735814abbff58f

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

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

Bug fix. Stream must outlive the pass manager.

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 llvm-branch-commits mailing list