Closed
Description
The current implementation of "deref_of_address" introduced in #76683 uses a backtracking algorithm.
That is, it first tries to locate a dereference of a local, e.g. _2 = (*_1)
. It then backtracks the previous statements for a definition of _1
. The current implementation has an heuristic look-back value of 6, which is arbitrarily chosen.
We should instead walk the statements in the order they appear in the basic blocks, keeping track of places where the optimization could be applied. This should both be faster since we only look at each statement once. And it will apply more optimizations as the heuristic look-back value is gone.