[LoopFlatten] Widen IV, support ZExt.
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Sat, 21 Nov 2020 14:13:36 +0000 (14:13 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Mon, 23 Nov 2020 08:57:19 +0000 (08:57 +0000)
commit33b2c88fa8223dbf15846ce18cc957e33e0d67fc
tree26d78f6cd48661a1c91c51e1c4038dc0912e2f38
parent18e4272a4fe4667a44f4d323140645a83ddfd864
[LoopFlatten] Widen IV, support ZExt.

I disabled the widening in fa5cb4b because it run in an assert, which was
related to replacing values with different types. I forgot that an extend could
also be a zero-extend, which I have added now. This means that the approach now
is to create and insert a trunc value of the outerloop for each user, and use
that to replace IV values.

Differential Revision: https://reviews.llvm.org/D91690
llvm/lib/Transforms/Scalar/LoopFlatten.cpp
llvm/test/Transforms/LoopFlatten/widen-iv.ll