[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
Loading
Please sign in to comment