[LIR] General refactor to improve compile-time and simplify code.
authorChad Rosier <mcrosier@codeaurora.org>
Wed, 11 Nov 2015 23:00:59 +0000 (23:00 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Wed, 11 Nov 2015 23:00:59 +0000 (23:00 +0000)
commit28d1976e2c58333bc1301d13a8da2ba733cac47f
tree08c505f6e71c442c5f61eb3f2a843ce722a04b39
parentfab9983f753127aee59427bf975963d83b87d110
[LIR] General refactor to improve compile-time and simplify code.

First create a list of candidates, then transform.  This simplifies the code in
that you have don't have to worry that you may be using an invalidated
iterator.

Previously, each time we created a memset/memcpy we would reevaluate the entire
loop potentially resulting in lots of redundant work for large basic blocks.

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