[Codegen] Move `LoweringConfigAttr` to an attribute interface
qedawkins opened this issue · comments
The #iree_codegen.lowering_config
attribute is designed such that different backends will interpret its contents differently. This is at odds with the the current implementation of the attribute which has a fixed set of fields and a number of backend specific member functions.
The addition of fields to this attribute means that all backends and any shared passes need to reason about it (likely just emitting errors). A recent example of the GPU side was the introduction of a special attribute on the TranslationInfo
to track the intended target intrinsic for an operation, however translation info applies globally.
The solution is to create an interface for LoweringConfig attributes that interfaces with common passes and has separate concrete implementations for backends that need it. Today the two primary shared passes are TileAndDistributeToWorkgroups
and GenericVectorization
So the interface methods to start will be
SmallVector<int64_t> getTileSizeVals(unsigned level);
SmallVector<int64_t> getNativeVectorSizeVals();