[IndVars] IV user should not prevent use widening
authorMax Kazantsev <mkazantsev@azul.com>
Thu, 12 Nov 2020 05:01:12 +0000 (12:01 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Thu, 12 Nov 2020 05:02:01 +0000 (12:02 +0700)
commitd6dd9385893e034c7c3561e5d47dc5cf3bce4552
tree510ac5c42b9fd7d8203c0cee550942bd07343216
parent8bc7b9278e55c4c8c731e7600a2d146438697964
[IndVars] IV user should not prevent use widening

Sometimes the an instruction we are trying to widen is used by the IV
(which means the instruction is the IV increment). Currently this may
prevent its widening. We should ignore such user because it will be
dead once the transform is done anyways.

Differential Revision: https://reviews.llvm.org/D90920
Reviewed By: fhahn
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll