[all-commits] [llvm/llvm-project] d1cff3: [MLIR][analysis] Lattice: Fix automatic delegation...
Andi Drebes via All-commits
all-commits at lists.llvm.org
Fri May 17 04:41:51 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d1cff36e5e37cd552ec049335feb1dd8f94517ea
https://github.com/llvm/llvm-project/commit/d1cff36e5e37cd552ec049335feb1dd8f94517ea
Author: Andi Drebes <47449897+andidr at users.noreply.github.com>
Date: 2024-05-17 (Fri, 17 May 2024)
Changed paths:
M mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
M mlir/test/lib/Analysis/DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
Log Message:
-----------
[MLIR][analysis] Lattice: Fix automatic delegation of meet to lattice value classes (#82620)
The class `Lattice` should automatically delegate invocations of the
meet operator to the meet operation of the associated lattice value
class if that class provides a static function called `meet`. This
process fails for two reasons:
1. `Lattice::has_meet` checks for a member function `meet` without
arguments of the lattice value class, although it should check for a
static member function.
2. The function template `Lattice::meet<VT>()` implementing the default
meet operation directly in the lattice is always present and takes
precedence over the delegating function template `Lattice::meet<VT,
std::integral_constant<bool, true>>()`.
This change fixes the automatic delegation of the meet operation of a
lattice to the lattice value class in the presence of a static `meet`
function by conditionally enabling either the delegating function
template or the non-delegating function template and by changing
`Lattice::has_meet` so that it checks for a static `meet` member
function in the lattice value type.
The test from `TestSparseBackwardDataFlowAnalysis.cpp` is changed, such
that the `meet` function is not provided directly in the `WrittenTo`
lattice, but by the `Lattice` base class in order to trigger delegation
to a lattice value class.
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