sightly better bufferization
minor fixes
This commit is contained in:
@@ -97,6 +97,11 @@ void PimMemory::allocateHost(ModuleOp moduleOp, func::FuncOp funcOp) {
|
||||
if (!allocOp->getParentOfType<pim::PimCoreOp>())
|
||||
gatherMemEntry(allocOp.getResult());
|
||||
});
|
||||
funcOp.walk([&](pim::PimEmptyManyOp emptyManyOp) {
|
||||
if (!emptyManyOp->getParentOfType<pim::PimCoreOp>() && !emptyManyOp->getParentOfType<pim::PimCoreBatchOp>())
|
||||
for (mlir::Value output : emptyManyOp.getOutputs())
|
||||
gatherMemEntry(output);
|
||||
});
|
||||
|
||||
allocateGatheredMemory();
|
||||
|
||||
@@ -106,6 +111,10 @@ void PimMemory::allocateHost(ModuleOp moduleOp, func::FuncOp funcOp) {
|
||||
|
||||
void PimMemory::allocateCore(Operation* op) {
|
||||
op->walk([&](memref::AllocOp allocOp) { gatherMemEntry(allocOp); });
|
||||
op->walk([&](pim::PimEmptyManyOp emptyManyOp) {
|
||||
for (mlir::Value output : emptyManyOp.getOutputs())
|
||||
gatherMemEntry(output);
|
||||
});
|
||||
|
||||
allocateGatheredMemory();
|
||||
}
|
||||
@@ -957,6 +966,8 @@ static int64_t codeGenCoreOps(Block& block, PimCodeGen& coreCodeGen) {
|
||||
coreCodeGen.codeGenVSoftmaxOp(vsoftmaxOp, knowledge);
|
||||
else if (auto getGlobalOp = dyn_cast<memref::GetGlobalOp>(op))
|
||||
coreCodeGen.codeGetGlobalOp(getGlobalOp, knowledge);
|
||||
else if (isa<pim::PimEmptyManyOp>(op))
|
||||
return success();
|
||||
else {
|
||||
op.emitError("Unsupported codegen for this operation");
|
||||
op.dump();
|
||||
|
||||
Reference in New Issue
Block a user