[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)
commit87f4a3de456427b22ab7dd8fcb0c2db58ef57c37
tree1aaf6d009c03c7a826849a60359c3d18e9f7b8eb
parent0e194faeeaa176ea5338cace99b672e8ff1d1dd1
[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

llvm-svn: 318377
llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/unittests/Analysis/ScalarEvolutionTest.cpp