@@ -83,32 +83,32 @@ index af4f13dc0936..28d49d9e91f0 100644
83
83
+ // `allowedRanges` list, the list has two values, start and end of the range (inclusive)
84
84
+ class IsVectorOfLengthRangePred<list<int> allowedRanges> :
85
85
+ And<[IsVectorTypePred,
86
- + And<[CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
86
+ + And<[CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
87
87
+ >= }]
88
88
+ # allowedRanges[0]>,
89
- + CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
89
+ + CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
90
90
+ <= }]
91
91
+ # allowedRanges[1]>]>]>;
92
92
+
93
93
+ // Whether the number of elements of a fixed-length vector is from the given
94
94
+ // `allowedRanges` list, the list has two values, start and end of the range (inclusive)
95
95
+ class IsFixedVectorOfLengthRangePred<list<int> allowedRanges> :
96
96
+ And<[IsFixedVectorTypePred,
97
- + And<[CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
97
+ + And<[CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
98
98
+ >= }]
99
99
+ # allowedRanges[0]>,
100
- + CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
100
+ + CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
101
101
+ <= }]
102
102
+ # allowedRanges[1]>]>]>;
103
103
+
104
104
+ // Whether the number of elements of a scalable vector is from the given
105
105
+ // `allowedRanges` list, the list has two values, start and end of the range (inclusive)
106
106
+ class IsScalableVectorOfLengthRangePred<list<int> allowedRanges> :
107
107
+ And<[IsVectorTypeWithAnyDimScalablePred,
108
- + And<[CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
108
+ + And<[CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
109
109
+ >= }]
110
110
+ # allowedRanges[0]>,
111
- + CPred<[{$_self. cast<::mlir::VectorType>().getNumElements()
111
+ + CPred<[{cast<::mlir::VectorType>($_self ).getNumElements()
112
112
+ <= }]
113
113
+ # allowedRanges[1]>]>]>;
114
114
+
@@ -201,7 +201,7 @@ index 3f25696aa5eb..2d64fea0dc26 100644
201
201
+ // Number of elements should be between [2 - 2^63 -1],
202
202
+ // since getNumElements() returns an unsigned, the upper limit check is
203
203
+ // unnecessary
204
- + return type.getRank() == 1 && type.getElementType(). isa<ScalarType>() &&
204
+ + return type.getRank() == 1 && mlir:: isa<ScalarType>(type.getElementType() ) &&
205
205
+ type.getNumElements() >= 2;
206
206
}
207
207
@@ -329,15 +329,15 @@ index 4072608dc8f8..3fc675632970 100644
329
329
+ //if (auto floatType = dyn_cast<FloatType>(type)) {
330
330
+ // Convert to 32-bit float and remove floatType related capability
331
331
+ // restriction
332
- + if (auto floatType = type. dyn_cast<FloatType>()) {
332
+ + if (auto floatType = dyn_cast<FloatType>(type )) {
333
333
LLVM_DEBUG(llvm::dbgs() << type << " converted to 32-bit for SPIR-V\n");
334
334
return Builder(targetEnv.getContext()).getF32Type();
335
335
}
336
336
337
337
- auto intType = cast<IntegerType>(type);
338
338
+ //auto intType = cast<IntegerType>(type);
339
339
+ // Convert to 32-bit int and remove intType related capability restriction
340
- + auto intType = type. cast<IntegerType>();
340
+ + auto intType = cast<IntegerType>(type );
341
341
LLVM_DEBUG(llvm::dbgs() << type << " converted to 32-bit for SPIR-V\n");
342
342
return IntegerType::get(targetEnv.getContext(), /*width=*/32,
343
343
intType.getSignedness());
@@ -403,9 +403,9 @@ index 4072608dc8f8..3fc675632970 100644
403
403
- cast<spirv::SPIRVType>(valueType).getCapabilities(typeCapabilities);
404
404
- if (failed(checkCapabilityRequirements(op->getName(), this->targetEnv,
405
405
- typeCapabilities)))
406
- + valueType. cast<spirv::SPIRVType>().getCapabilities(typeCapabilities);
406
+ + cast<spirv::SPIRVType>(valueType ).getCapabilities(typeCapabilities);
407
407
+ typeExtensions.clear();
408
- + valueType. cast<spirv::SPIRVType>().getExtensions(typeExtensions);
408
+ + cast<spirv::SPIRVType>(valueType ).getExtensions(typeExtensions);
409
409
+ // Checking for capability and extension requirements along with capability
410
410
+ // infered extensions
411
411
+ // If a capability is present, the extension that
0 commit comments