LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
LightweightSignalEquivalenceAnalysis.h
Go to the documentation of this file.
1//===- LightweightSignalEquivalenceAnalysis.h -------------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9
10#pragma once
11
12#include <mlir/IR/Operation.h>
13
14#include <llvm/ADT/EquivalenceClasses.h>
15
16namespace llzk {
17
18struct ValueLess {
19 bool operator()(const mlir::Value &v1, const mlir::Value &v2) const {
20 return v1.getAsOpaquePointer() < v2.getAsOpaquePointer();
21 }
22};
23
25 llvm::EquivalenceClasses<mlir::Value, ValueLess> equivalentSignals;
26
27public:
28 LightweightSignalEquivalenceAnalysis(mlir::Operation *op);
29 bool areSignalsEquivalent(mlir::Value v1, mlir::Value v2);
30};
31
32} // namespace llzk
bool operator()(const mlir::Value &v1, const mlir::Value &v2) const