This is split from https://reviews.llvm.org/D86925
Per @qcolombet comments, if the instruction's operand is defined inside the loop, we should not treat it as profitable directly in D86925. https://reviews.llvm.org/D86925#2271795
This patch handles this pattern for some cases. If the operand is defined inside the loop, but the target bb's register pressure is not too high, we still treat this sinking as profitable. Because move the def down will make some variables live interval smaller.