fix weightAlways attribute in spatial
This commit is contained in:
@@ -392,7 +392,9 @@ void ONNXToSpatialPass::mergeTriviallyConnectedComputes(func::FuncOp funcOp) {
|
||||
void ONNXToSpatialPass::annotateWeightsConstants(func::FuncOp funcOp) const {
|
||||
funcOp.walk([&](arith::ConstantOp constantOp) {
|
||||
bool isAlwaysWeight =
|
||||
llvm::all_of(constantOp->getUsers(), [](auto user) -> bool { return isa<spatial::SpatCompute>(user); });
|
||||
!constantOp->use_empty() && llvm::all_of(constantOp->getUses(), [](OpOperand& use) -> bool {
|
||||
return isSpatialMvmVmmWeightUse(use);
|
||||
});
|
||||
if (isAlwaysWeight)
|
||||
markWeightAlways(constantOp);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user