Unverified Commit 862aa5fe authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

Merge pull request #3325 from NervanaSystems/nmostafa/mergefix

[MLIR] Fix bad merge on 2 MLIR changes
parents fc9a7dea c4dfca3b
...@@ -137,9 +137,9 @@ namespace ...@@ -137,9 +137,9 @@ namespace
private: private:
NGraphTypeConverter typeConverter; NGraphTypeConverter typeConverter;
// Value holding mem manager passed pointer // Value holding mem manager passed pointer
SmallVector<Value*, 4> m_memMgrDefs; SmallVector<Value*, 4> memMgrDefs;
// List of temporary memrefs to deallocate at end of function // List of temporary memrefs to deallocate at end of function
SmallVector<Value*, 4> m_memRefsToDealloc; SmallVector<Value*, 4> memRefsToDealloc;
// list of results values to add to func signature // list of results values to add to func signature
SmallVector<Value*, 4> loweredOutputValues; SmallVector<Value*, 4> loweredOutputValues;
ngmlir::MLIRCompiler& compiler; ngmlir::MLIRCompiler& compiler;
...@@ -264,7 +264,7 @@ namespace ...@@ -264,7 +264,7 @@ namespace
NGRAPH_CHECK(memRefType.hasStaticShape(), "Dynamic shapes are not supported"); NGRAPH_CHECK(memRefType.hasStaticShape(), "Dynamic shapes are not supported");
Value* alloc = rewriter.create<mlir::AllocOp>(rewriter.getUnknownLoc(), memRefType); Value* alloc = rewriter.create<mlir::AllocOp>(rewriter.getUnknownLoc(), memRefType);
m_memRefsToDealloc.push_back(alloc); memRefsToDealloc.push_back(alloc);
// TODO: // TODO:
// Enable dynamic memref allocation via call-back to nGraph allocator // Enable dynamic memref allocation via call-back to nGraph allocator
...@@ -342,7 +342,7 @@ namespace ...@@ -342,7 +342,7 @@ namespace
void DialectLoweringPass::insertDeallocs(PatternRewriter& rewriter) void DialectLoweringPass::insertDeallocs(PatternRewriter& rewriter)
{ {
for (auto value : m_memRefsToDealloc) for (auto value : memRefsToDealloc)
{ {
rewriter.create<DeallocOp>(rewriter.getUnknownLoc(), value); rewriter.create<DeallocOp>(rewriter.getUnknownLoc(), value);
} }
...@@ -777,7 +777,7 @@ namespace ...@@ -777,7 +777,7 @@ namespace
REWRITER(NGReturnOp) REWRITER(NGReturnOp)
{ {
m_pass.insertDeallocs(rewriter); pass.insertDeallocs(rewriter);
rewriter.replaceOpWithNewOp<ReturnOp>(op); rewriter.replaceOpWithNewOp<ReturnOp>(op);
return matchSuccess(); return matchSuccess();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment