Skip to content
Commit 2453da0a authored by Momchil Velikov's avatar Momchil Velikov
Browse files

[CodeGenPrepare] Fix counting uses when folding addresses into memory instructions

The counter of the number of instructions seen in `FindAllMemoryUses`
is reset after returning from a recursive invocation of
`FindAllMemoryUses` to the value it had before the call. In effect,
depending on the shape of the uses graph, the function may scan up to
`2^N-1` instructions where `N` is the scan limit
(`MaxMemoryUsesToScan`).  This does not look intuitive or intended.

This patch changes the counting to just count the scanned
instructions, independent of the shape of the references.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D143893

Change-Id: I99f5de55e84843cf2fbea287d6ae4312fa196240
parent 18fe6639
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment