[LICM] Don't try to sink values out of loops without any exits
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 12 Jul 2015 03:53:05 +0000 (03:53 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 12 Jul 2015 03:53:05 +0000 (03:53 +0000)
commit6bc83e0f430bcfd798561815778f4777801fc4f8
tree05b36746f9d964fb2fb2cecc3b73ea5d1433120f
parent305fa9c2bfcd847171a1680a3b1b9ae69451ab26
[LICM] Don't try to sink values out of loops without any exits

There is no suitable basic block to sink instructions in loops without
exits.  The only way an instruction in a loop without exits can be used
is as an incoming value to a PHI.  In such cases, the incoming block for
the corresponding value is unreachable.

This fixes PR24013.

Differential Revision: http://reviews.llvm.org/D10903

llvm-svn: 241987
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/PR24013.ll [new file with mode: 0644]