[Constant Hoisting] Materialize the constant before the cloned cast instruction.
authorJuergen Ributzka <juergen@apple.com>
Tue, 22 Apr 2014 18:06:58 +0000 (18:06 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 22 Apr 2014 18:06:58 +0000 (18:06 +0000)
commitb95412cc24e99a72ee3efc05a14995bb508f3a23
treee1f874978061a15d38f1f8f8965ec04f4774b039
parent0db2ba1ce88fa705ae48e200cc020d1539ed11ec
[Constant Hoisting] Materialize the constant before the cloned cast instruction.

In the case where the constant comes from a cloned cast instruction, the
materialization code has to go before the cloned cast instruction.

This commit fixes the method that finds the materialization insertion point
by making it aware of this case.

This fixes <rdar://problem/15532441>

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