Refactor ONNXToSpatial Common and diagnostics
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "mlir/IR/IRMapping.h"
|
||||
#include "mlir/IR/PatternMatch.h"
|
||||
#include "mlir/IR/Value.h"
|
||||
|
||||
namespace onnx_mlir {
|
||||
|
||||
/// Returns true when a matrix-valued compute operand is ultimately backed by a
|
||||
/// weight-marked constant/view chain and can be promoted into weights.
|
||||
bool isWeightLikeComputeOperand(mlir::Value value);
|
||||
|
||||
/// Rebuilds the view/transpose chain of a promoted weight operand inside a new
|
||||
/// compute body while reusing already-materialized intermediate values.
|
||||
llvm::FailureOr<mlir::Value>
|
||||
materializeWeightLikeValueInBlock(mlir::Value value, mlir::IRRewriter& rewriter, mlir::IRMapping& mapper);
|
||||
|
||||
} // namespace onnx_mlir
|
||||
Reference in New Issue
Block a user