Skip to content

Commit c8dde7a

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents e7cf799 + 23ee1e9 commit c8dde7a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

build_tools/patches/0001-Add-support-for-VectorAnyINTEL-capability.patch

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,32 @@ index af4f13dc0936..28d49d9e91f0 100644
8383
+// `allowedRanges` list, the list has two values, start and end of the range (inclusive)
8484
+class IsVectorOfLengthRangePred<list<int> allowedRanges> :
8585
+ And<[IsVectorTypePred,
86-
+ And<[CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
86+
+ And<[CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
8787
+ >= }]
8888
+ # allowedRanges[0]>,
89-
+ CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
89+
+ CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
9090
+ <= }]
9191
+ # allowedRanges[1]>]>]>;
9292
+
9393
+// Whether the number of elements of a fixed-length vector is from the given
9494
+// `allowedRanges` list, the list has two values, start and end of the range (inclusive)
9595
+class IsFixedVectorOfLengthRangePred<list<int> allowedRanges> :
9696
+ And<[IsFixedVectorTypePred,
97-
+ And<[CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
97+
+ And<[CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
9898
+ >= }]
9999
+ # allowedRanges[0]>,
100-
+ CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
100+
+ CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
101101
+ <= }]
102102
+ # allowedRanges[1]>]>]>;
103103
+
104104
+// Whether the number of elements of a scalable vector is from the given
105105
+// `allowedRanges` list, the list has two values, start and end of the range (inclusive)
106106
+class IsScalableVectorOfLengthRangePred<list<int> allowedRanges> :
107107
+ And<[IsVectorTypeWithAnyDimScalablePred,
108-
+ And<[CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
108+
+ And<[CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
109109
+ >= }]
110110
+ # allowedRanges[0]>,
111-
+ CPred<[{$_self.cast<::mlir::VectorType>().getNumElements()
111+
+ CPred<[{cast<::mlir::VectorType>($_self).getNumElements()
112112
+ <= }]
113113
+ # allowedRanges[1]>]>]>;
114114
+
@@ -201,7 +201,7 @@ index 3f25696aa5eb..2d64fea0dc26 100644
201201
+ // Number of elements should be between [2 - 2^63 -1],
202202
+ // since getNumElements() returns an unsigned, the upper limit check is
203203
+ // unnecessary
204-
+ return type.getRank() == 1 && type.getElementType().isa<ScalarType>() &&
204+
+ return type.getRank() == 1 && mlir::isa<ScalarType>(type.getElementType()) &&
205205
+ type.getNumElements() >= 2;
206206
}
207207

@@ -329,15 +329,15 @@ index 4072608dc8f8..3fc675632970 100644
329329
+ //if (auto floatType = dyn_cast<FloatType>(type)) {
330330
+ // Convert to 32-bit float and remove floatType related capability
331331
+ // restriction
332-
+ if (auto floatType = type.dyn_cast<FloatType>()) {
332+
+ if (auto floatType = dyn_cast<FloatType>(type)) {
333333
LLVM_DEBUG(llvm::dbgs() << type << " converted to 32-bit for SPIR-V\n");
334334
return Builder(targetEnv.getContext()).getF32Type();
335335
}
336336

337337
- auto intType = cast<IntegerType>(type);
338338
+ //auto intType = cast<IntegerType>(type);
339339
+ // Convert to 32-bit int and remove intType related capability restriction
340-
+ auto intType = type.cast<IntegerType>();
340+
+ auto intType = cast<IntegerType>(type);
341341
LLVM_DEBUG(llvm::dbgs() << type << " converted to 32-bit for SPIR-V\n");
342342
return IntegerType::get(targetEnv.getContext(), /*width=*/32,
343343
intType.getSignedness());
@@ -403,9 +403,9 @@ index 4072608dc8f8..3fc675632970 100644
403403
- cast<spirv::SPIRVType>(valueType).getCapabilities(typeCapabilities);
404404
- if (failed(checkCapabilityRequirements(op->getName(), this->targetEnv,
405405
- typeCapabilities)))
406-
+ valueType.cast<spirv::SPIRVType>().getCapabilities(typeCapabilities);
406+
+ cast<spirv::SPIRVType>(valueType).getCapabilities(typeCapabilities);
407407
+ typeExtensions.clear();
408-
+ valueType.cast<spirv::SPIRVType>().getExtensions(typeExtensions);
408+
+ cast<spirv::SPIRVType>(valueType).getExtensions(typeExtensions);
409409
+ // Checking for capability and extension requirements along with capability
410410
+ // infered extensions
411411
+ // If a capability is present, the extension that

0 commit comments

Comments
 (0)