#pragma once #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/IR/PatternMatch.h" #include "mlir/IR/Value.h" #include "mlir/Transforms/FoldUtils.h" namespace onnx_mlir { mlir::Block* getHostConstantBlock(mlir::Operation* anchorOp); mlir::Value getOrCreateHostConstant(mlir::Operation* anchorOp, mlir::Attribute value, mlir::Type type, mlir::OperationFolder& folder); mlir::Value getOrCreateHostConstant(mlir::Operation* anchorOp, mlir::Attribute value, mlir::Type type, mlir::RewriterBase& rewriter); mlir::Value getOrCreateHostConstantLike(mlir::arith::ConstantOp constantOp, mlir::OperationFolder& folder); mlir::Value getOrCreateHostIndexConstant(mlir::Operation* anchorOp, int64_t value, mlir::OperationFolder& folder); mlir::Value getOrCreateHostIndexConstant(mlir::Operation* anchorOp, int64_t value, mlir::RewriterBase& rewriter); mlir::Value getOrCreateHostI32Constant(mlir::Operation* anchorOp, int32_t value, mlir::OperationFolder& folder); mlir::Value getOrCreateHostI64Constant(mlir::Operation* anchorOp, int64_t value, mlir::OperationFolder& folder); } // namespace onnx_mlir