teh only weight (WIP)
Validate Operations / validate-operations (push) Has been cancelled

This commit is contained in:
NiccoloN
2026-05-26 18:42:14 +02:00
parent addfc8a86e
commit d609e84054
17 changed files with 1031 additions and 630 deletions
+5 -10
View File
@@ -50,10 +50,9 @@ static bool isBatchOutputArgument(SpatComputeBatch batchOp, Value value) {
template <typename ComputeOpTy>
static LogicalResult verifyStaticWeights(ComputeOpTy computeOp, StringRef kind) {
for (Value weight : computeOp.getWeights()) {
for (Value weight : computeOp.getWeights())
if (!isCompileTimeComputable(weight))
return computeOp.emitOpError() << kind << " weights must be statically computed from constants";
}
return success();
}
@@ -131,11 +130,9 @@ verifyStaticUnitStrideExtractSliceOp(tensor::ExtractSliceOp sliceOp, BlockArgume
return sliceOp.emitOpError() << kind << " requires static slice sizes";
auto offsets = sliceOp.getOffsets();
for (auto [offsetIndex, offset] : llvm::enumerate(offsets)) {
bool supported = offsetIndex == 0 ? isSupportedLaneOffsetExpr(offset, laneArg) : isConstantIndexLike(offset);
if (!supported)
for (Value offset : offsets)
if (!isSupportedLaneOffsetExpr(offset, laneArg))
return sliceOp.emitOpError() << kind << " requires simple lane-dependent offsets";
}
return success();
}
@@ -155,11 +152,9 @@ static LogicalResult verifyStaticUnitStrideParallelInsertSliceOp(tensor::Paralle
return sliceOp.emitOpError() << kind << " requires static slice sizes";
auto offsets = sliceOp.getOffsets();
for (auto [offsetIndex, offset] : llvm::enumerate(offsets)) {
bool supported = offsetIndex == 0 ? isSupportedLaneOffsetExpr(offset, laneArg) : isConstantIndexLike(offset);
if (!supported)
for (Value offset : offsets)
if (!isSupportedLaneOffsetExpr(offset, laneArg))
return sliceOp.emitOpError() << kind << " requires simple lane-dependent offsets";
}
return success();
}