Set basic framework for detecting reductions.

Rationale:
Recognize reductions in loops. Note that reductions are *not*
optimized yet (we would proceed with e.g. unrolling and vectorization).
This CL merely sets up the basic detection framework. Also does
a bit of cleanup on loop optimization code.

Bug: 64091002
Test: test-art-host

Change-Id: I0f52bd7ca69936315b03d02e83da743b8ad0ae72
6 files changed