[all-commits] [llvm/llvm-project] 0c1deb: [mlir][Transforms] Dialect Conversion: Remove redu...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sat Sep 28 08:33:55 PDT 2024


  Branch: refs/heads/users/matthias-springer/redundant_lookup
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c1deb1ee36a0ec0ef45565c0bd310a7930600f7
      https://github.com/llvm/llvm-project/commit/0c1deb1ee36a0ec0ef45565c0bd310a7930600f7
  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