[LICM] Invalidate SCEV upon instruction hoisting
authorSerguei Katkov <serguei.katkov@azul.com>
Thu, 31 Oct 2019 10:18:29 +0000 (17:18 +0700)
committerSerguei Katkov <serguei.katkov@azul.com>
Thu, 31 Oct 2019 10:37:53 +0000 (17:37 +0700)
commit1eb04d289a6fb4c7cb75f69312a7b949987e7c97
treefff7eb8c0ba9147426138abd2a1cce8053e27285
parent193a7bfb697b5d2adb1c3d37a9d624aa8131ec35
[LICM] Invalidate SCEV upon instruction hoisting

Since SCEV can cache information about location of an instruction, it should be invalidated when the instruction is moved.
There should be similar bug in code sinking part of LICM, it will be fixed in a follow-up change.

Patch Author: Daniil Suchkov
Reviewers: asbirlea, mkazantsev, reames
Reviewed By: asbirlea
Subscribers: hiraditya, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D69370
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/unittests/Transforms/Scalar/LICMTest.cpp