[SimplifyIndVar] Extract out invariant expression handling
authorPhilip Reames <listmail@philipreames.com>
Tue, 31 Oct 2017 04:19:06 +0000 (04:19 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 31 Oct 2017 04:19:06 +0000 (04:19 +0000)
commit39a8dbff8760adfa55942c61d6e75dd432d30875
treea67413409ed1129d7d1cd8fe0e729b6f767f360b
parent668b1ab6f1c5b0c65e4b456f37dba0c2d588b52f
[SimplifyIndVar] Extract out invariant expression handling

Previously, the code returned early from the *function* when it couldn't find a free expansion, it should be returning from the *transform*.  I don't have a test case, noticed this via inspection.

As a follow up, I'm going to revisit the logic in the extract function.  I think that essentially the whole helper routine can be replaced with SCEVExpander, but I wanted to do that in a series of separate commits.

llvm-svn: 316974
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp