llvm-6502/lib/Transforms
Andrew Trick c846d65f99 Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists things.
getSCEV for an ashr instruction creates an intermediate zext
expression when it truncates its operand.

The operand is initially inside the loop, so the narrow zext
expression has a non-loop-invariant loop disposition.

LoopSimplify then runs on an outer loop, hoists the ashr operand, and
properly invalidate the SCEVs that are mapped to value.

The SCEV expression for the ashr is now an AddRec with the hoisted
value as the now loop-invariant start value.

The LoopDisposition of this wide value was properly invalidated during
LoopSimplify.

However, if we later get the ashr SCEV again, we again try to create
the intermediate zext expression. We get the same SCEV that we did
earlier, and it is still cached because it was never mapped to a
Value. When we try to create a new AddRec we abort because we're using
the old non-loop-invariant LoopDisposition.

I don't have a solution for this other than to clear LoopDisposition
when LoopSimplify hoists things.

I think the long-term strategy should be to perform LoopSimplify on
all loops before computing SCEV and before running any loop opts on
individual loops. It's possible we may want to rerun LoopSimplify on
individual loops, but it should rarely do anything, so rarely require
invalidating SCEV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198478 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-04 05:52:49 +00:00
..
Hello Set LLVM_EXPORTED_SYMBOL_FILE in CMakeLists whose corresponding Makefiles do so. 2013-12-29 23:06:49 +00:00
InstCombine Stay classy (and legal) LLVM. Remove links to 3rd party SMT solver whose links may not be permanent. 2013-12-19 18:35:54 +00:00
Instrumentation [ASan] Fix the test for __asan_gen_ globals and actually fix http://llvm.org/bugs/show_bug.cgi?id=17976 2013-12-25 16:46:27 +00:00
IPO Delete unread globals through addrspacecast 2014-01-02 20:01:43 +00:00
ObjCARC Correct word hyphenations 2013-12-05 05:44:44 +00:00
Scalar Add a LLVM_DUMP_METHOD macro. 2014-01-03 22:53:37 +00:00
Utils Fix PR18361: Invalidate LoopDispositions after LoopSimplify hoists things. 2014-01-04 05:52:49 +00:00
Vectorize LoopVectorizer: Don't if-convert constant expressions that can trap 2013-12-17 01:11:01 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile