@@ -2094,41 +2094,3 @@ LogicalResult spirv::VectorTimesScalarOp::verify() {
20942094 return emitOpError (" scalar operand and result element type match" );
20952095 return success ();
20962096}
2097-
2098- // ===----------------------------------------------------------------------===//
2099- // spirv.GLDistanceOp
2100- // ===----------------------------------------------------------------------===//
2101-
2102- LogicalResult spirv::GLDistanceOp::verify () {
2103- auto p0Type = getP0 ().getType ();
2104- auto p1Type = getP1 ().getType ();
2105- auto resultType = getResult ().getType ();
2106-
2107- auto getFloatType = [](Type type) -> FloatType {
2108- if (auto vectorType = llvm::dyn_cast<VectorType>(type))
2109- return llvm::dyn_cast<FloatType>(vectorType.getElementType ());
2110- return llvm::dyn_cast<FloatType>(type);
2111- };
2112-
2113- FloatType p0FloatType = getFloatType (p0Type);
2114- FloatType p1FloatType = getFloatType (p1Type);
2115- FloatType resultFloatType = llvm::dyn_cast<FloatType>(resultType);
2116-
2117- if (!p0FloatType || !p1FloatType || !resultFloatType)
2118- return emitOpError (
2119- " operands and result must be float scalar or vector of float" );
2120-
2121- if (p0FloatType != resultFloatType || p1FloatType != resultFloatType)
2122- return emitOpError (" operand and result element types must match" );
2123-
2124- if (auto p0Vec = llvm::dyn_cast<VectorType>(p0Type)) {
2125- if (!llvm::dyn_cast<VectorType>(p1Type) ||
2126- p0Vec.getShape () != llvm::dyn_cast<VectorType>(p1Type).getShape ())
2127- return emitOpError (" vector operands must have same shape" );
2128- } else if (llvm::isa<VectorType>(p1Type)) {
2129- return emitOpError (
2130- " expected both operands to be scalars or both to be vectors" );
2131- }
2132-
2133- return success ();
2134- }
0 commit comments