[IndVarSimplify] Don't insert after a catchswitch
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 30 Mar 2016 21:12:06 +0000 (21:12 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 30 Mar 2016 21:12:06 +0000 (21:12 +0000)
commit5d518386b658f51e18e77d31e2f823c171572b71
tree651018acda3c8482de9079ca6efdf6dba5085e28
parentbbaf5e0acf8870dd1b77afeb7ab09bf875d29b01
[IndVarSimplify] Don't insert after a catchswitch

Widening a PHI requires us to insert a trunc.
The logical place for this trunc is in the same BB as the PHI.
This is not possible if the BB is terminated by a catchswitch.

This fixes PR27133.

llvm-svn: 264926
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/pr27133.ll [new file with mode: 0644]