[LICM] Sinking doesn't involve the preheader
authorPhilip Reames <listmail@philipreames.com>
Fri, 22 May 2015 02:14:05 +0000 (02:14 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 22 May 2015 02:14:05 +0000 (02:14 +0000)
commit2c78f9499c162b3448aac585374e7d5d52f64605
tree055468643fbb785ae090b6ebc4f291500b89ca97
parent253c092e568a015e03f638aa430623b460bd4f77
[LICM] Sinking doesn't involve the preheader

PR23608 pointed out that using the preheader to gain a context instruction isn't always legal because a loop might not have a preheader.  When looking into that, I realized that using the preheader to determine legality for sinking is questionable at best.  Given no test covers that case and the original commit didn't seem to intend it, I restructured the code to only ask context sensative queries for hoising of loads and stores.  This is effectively a partial revert of 237593.

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