[LV] Never widen an induction variable.
authorJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:05 +0000 (10:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:05 +0000 (10:15 +0000)
commitfe89784bf1d661516f47c9ff0f1d0eaa94e35966
treed66f58a164534faa9e1da18475caf3f5961c92d4
parent390bcc0ac8c73dd81e1929382f2af5927d3d5ae7
[LV] Never widen an induction variable.

There's no need to widen canonical induction variables. It's just as efficient to create a *new*, wide, induction variable.

Consider, if we widen an indvar, then we'll have to truncate it before its uses anyway (1 trunc). If we create a new indvar instead, we'll have to truncate that instead (1 trunc) [besides which IndVars should go and clean up our mess after us anyway on principle].

This lets us remove a ton of special-casing code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246631 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/ptr-induction.ll [new file with mode: 0644]