better throughput scheduling with steady state cost model, now limited to spatial
This commit is contained in:
@@ -10,6 +10,18 @@ using namespace mlir;
|
||||
|
||||
namespace onnx_mlir {
|
||||
|
||||
bool isZeroBitPatternSplat(Attribute value) {
|
||||
auto dense = dyn_cast_or_null<DenseElementsAttr>(value);
|
||||
if (!dense || !dense.isSplat())
|
||||
return false;
|
||||
Attribute element = dense.getSplatValue<Attribute>();
|
||||
if (auto floating = dyn_cast<FloatAttr>(element))
|
||||
return floating.getValue().isZero() && !floating.getValue().isNegative();
|
||||
if (auto integer = dyn_cast<IntegerAttr>(element))
|
||||
return integer.getValue().isZero();
|
||||
return false;
|
||||
}
|
||||
|
||||
ConstantPool::ConstantPool(Operation *constantAnchor, OpBuilder &builder)
|
||||
: anchor(constantAnchor), block(getConstantInsertionBlock(constantAnchor)),
|
||||
builder(builder) {
|
||||
|
||||
Reference in New Issue
Block a user