[Unroll] Separate the logic for testing each iteration of the loop,
authorChandler Carruth <chandlerc@gmail.com>
Fri, 22 May 2015 17:41:35 +0000 (17:41 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 22 May 2015 17:41:35 +0000 (17:41 +0000)
commit15fe7cf70fc92f9e7623fd2c7ffd38662cc29b1b
treeff0c6b835abdb7c19e35364dd0bb3c887eed0d66
parent490d207be4ba9a12cc677ad3cd20c0e1b0231446
[Unroll] Separate the logic for testing each iteration of the loop,
accumulating estimated cost, and other loop-centric logic from the logic
used to analyze instructions in a particular iteration.

This makes the visitor very narrow in scope -- all it does is visit
instructions, update a map of simplified values, and return whether it
is able to optimize away a particular instruction.

The two cost metrics are now returned as an optional struct. When the
optional is left unengaged, there is no information about the unrolled
cost of the loop, when it is engaged the cost metrics are available to
run against the thresholds.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238033 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopUnrollPass.cpp