[Mlir-commits] [mlir] [MLIR][LLVM] Fix #llvm.constant_range crashing in storage uniquer (PR #135772)

Henrich Lauko llvmlistbot at llvm.org
Tue Apr 15 06:00:37 PDT 2025


xlauko wrote:

A alternative solution is to add custom StorageClass for this:  https://github.com/trailofbits/instafix-llvm/pull/23/commits/83a8b2b7ee93b4547105e31e1e4e0243c3099a41 
with
```cpp
  /// The hash key for this storage is a pair of the integer and type params.
  using KeyTy = std::pair<llvm::APInt, llvm::APInt>;

  /// Define the comparison function for the key type.
  bool operator==(const KeyTy &key) const {
    if (lower.getBitWidth() != key.first.getBitWidth() ||
        upper.getBitWidth() != key.second.getBitWidth()) {
      return false;
    }
    return lower == key.first && upper == key.second;
  }
```

https://github.com/llvm/llvm-project/pull/135772


More information about the Mlir-commits mailing list