[Mlir-commits] [mlir] [MLIR][DLTI] Pretty parsing and printing for DLTI attrs (PR #113365)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Mon Oct 28 16:16:17 PDT 2024
================
@@ -382,27 +434,46 @@ TargetDeviceSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
LogicalResult
TargetSystemSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
- ArrayRef<DeviceIDTargetDeviceSpecPair> entries) {
- DenseSet<TargetSystemSpecInterface::DeviceID> device_ids;
+ ArrayRef<DataLayoutEntryInterface> entries) {
+ DenseSet<TargetSystemSpecInterface::DeviceID> deviceIds;
for (const auto &entry : entries) {
- TargetDeviceSpecInterface target_device_spec = entry.second;
-
- // First verify that a target device spec is valid.
- if (failed(TargetDeviceSpecAttr::verify(emitError,
- target_device_spec.getEntries())))
- return failure();
+ auto deviceId =
+ llvm::dyn_cast<TargetSystemSpecInterface::DeviceID>(entry.getKey());
----------------
ftynse wrote:
Here and below. Casts are re-exported into the `mlir` namespace and we should use them without namespaces, except weird tempalting cases and tablegen, which may end up being emitted into a different namespace and where we should use globally-qualified namespaces.
https://github.com/llvm/llvm-project/pull/113365
More information about the Mlir-commits
mailing list