[all-commits] [llvm/llvm-project] f321b9: [mlir][Transforms] Dialect Conversion: Remove redu...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Sat Sep 28 08:22:01 PDT 2024
Branch: refs/heads/users/matthias-springer/redundant_lookup
Home: https://github.com/llvm/llvm-project
Commit: f321b97e86a5a6e3e8876b9e5e7efdf70d9e0c3e
https://github.com/llvm/llvm-project/commit/f321b97e86a5a6e3e8876b9e5e7efdf70d9e0c3e
Author: Matthias Springer <mspringer at nvidia.com>
Date: 2024-09-28 (Sat, 28 Sep 2024)
Changed paths:
M mlir/lib/Transforms/Utils/DialectConversion.cpp
Log Message:
-----------
[mlir][Transforms] Dialect Conversion: Remove redundant `lookupOrDefault`
Remove a redundant `lookupOrDefault` that has no effect.
When no type is passed to `lookupOrDefault`, that function returns the furthest mapped value (by following the mapping iteratively).
The value that was passed to the redundant `lookupOrDefault` was produced by this code:
```
Value newOperand = mapping.lookupOrDefault(operand, desiredType);
```
There are 2 possible cases:
- Case 1: There is no mapping to `desiredType`. Then `newOperand` is the furthest mapped value.
- Case 2: There is a mapping to `desiredType`. Then the type of `newOperand` is `desiredType` and the "if" branch that encloses the redundant `lookupOrDefault` is not executed at all.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list