[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)
commita1b821fac967dedd4b39d2dc8ce58e54a6cecacd
tree7ee81132732a84f8c8c427648f6af5442e23f562
parent866cf31c07b469f8fa60ce02244e71188d569a01
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241987 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/PR24013.ll [new file with mode: 0644]