forked from OSchip/llvm-project
Avoid dyn_cast to ShapedType
ShapedType just indicates shape/rank/element semantics. It's generally not useful for other type checking. This check already checks for vector or tensor type, so we can use a direct cast if we check those first. Related to making MemRefType a subclass of ShapedType -- PiperOrigin-RevId: 250583231
This commit is contained in:
parent
66e84bf88c
commit
9ebab7bc30
mlir/lib/Quantizer/Configurations
|
@ -96,9 +96,8 @@ struct FxpMathTargetConfigImpl : public FxpMathTargetConfig {
|
|||
bool isHandledType(Type t) const final {
|
||||
if (t.isa<FloatType>())
|
||||
return true;
|
||||
auto shapedType = t.dyn_cast<ShapedType>();
|
||||
return (shapedType && shapedType.getElementType().isa<FloatType>() &&
|
||||
(t.isa<VectorType>() || t.isa<TensorType>()));
|
||||
return (t.isa<VectorType>() || t.isa<TensorType>()) &&
|
||||
t.cast<ShapedType>().getElementType().isa<FloatType>();
|
||||
}
|
||||
|
||||
void finalizeAnchors(CAGSlice &cag) const override {
|
||||
|
|
Loading…
Reference in New Issue