OSDN Git Service

[SCEV][NFC] Introduce isSafeToExpandAt function to SCEVExpander
authorMax Kazantsev <max.kazantsev@azul.com>
Thu, 16 Nov 2017 05:10:56 +0000 (05:10 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Thu, 16 Nov 2017 05:10:56 +0000 (05:10 +0000)
commitcb0def446ff5cce133b3ec706156d881b8691864
treec31aeab402b20029c0b33229987dcd5cf8aed2ef
parent74e1e117455ae827d1c1f1921c7832bc7f8548ef
[SCEV][NFC] Introduce isSafeToExpandAt function to SCEVExpander

This function checks that:
1) It is safe to expand a SCEV;
2) It is OK to materialize it at the specified location.
For example, attempt to expand a loop's AddRec to the same loop's preheader should fail.

Differential Revision: https://reviews.llvm.org/D39236

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318377 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp
unittests/Analysis/ScalarEvolutionTest.cpp