[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:18 PDT 2024
================
@@ -197,8 +202,10 @@ def DLTI_TargetSystemSpecAttr :
$cppClass::getDeviceSpecForDeviceID(
TargetSystemSpecInterface::DeviceID deviceID) {
for (const auto& entry : getEntries()) {
- if (entry.first == deviceID)
- return entry.second;
+ if (entry.getKey() == DataLayoutEntryKey(deviceID))
+ if (auto deviceSpec =
+ llvm::dyn_cast<TargetDeviceSpecInterface>(entry.getValue()))
----------------
ftynse wrote:
```suggestion
::llvm::dyn_cast<TargetDeviceSpecInterface>(entry.getValue()))
```
https://github.com/llvm/llvm-project/pull/113365
More information about the Mlir-commits
mailing list