LoopVectorize fix: LoopInfo must be valid when invoking utils like SCEVExpander.
authorAndrew Trick <atrick@apple.com>
Sat, 13 Jul 2013 06:20:06 +0000 (06:20 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 13 Jul 2013 06:20:06 +0000 (06:20 +0000)
commit9a26e1320b3510623c052324de18b1324f92fee2
tree283fb193a14ff4834bb28ae61f1c040e46996eaa
parent718af7892033aa965efafbf63c7636d91728662b
LoopVectorize fix: LoopInfo must be valid when invoking utils like SCEVExpander.

In general, one should always complete CFG modifications first, update
CFG-based analyses, like Dominatores and LoopInfo, then generate
instruction sequences.

LoopVectorizer was creating a new loop, calling SCEVExpander to
generate checks, then updating LoopInfo. I just changed the order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186241 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/scev-exitlim-crash.ll [new file with mode: 0644]