[CodeExtractor] Fix sinking of allocas with multiple bitcast uses (PR42451)
authorVedant Kumar <vsk@apple.com>
Wed, 10 Jul 2019 16:32:20 +0000 (16:32 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 10 Jul 2019 16:32:20 +0000 (16:32 +0000)
commit5eb6ba060a2fdb34ef92ab833b81ad183b2cbbfe
tree6795d4f0720e1c61269710f6ffca16e94d52e339
parentf65f302cc7af68e5bc7dc9ee8f6761ed6514fadb
[CodeExtractor] Fix sinking of allocas with multiple bitcast uses (PR42451)

An alloca which can be sunk into the extraction region may have more
than one bitcast use. Move these uses along with the alloca to prevent
use-before-def.

Testing: check-llvm, stage2 build of clang

Fixes llvm.org/PR42451.

Differential Revision: https://reviews.llvm.org/D64463

llvm-svn: 365660
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/test/Transforms/CodeExtractor/live_shrink_multiple.ll
llvm/test/Transforms/HotColdSplit/sink-multiple-bitcasts-of-allocas-pr42451.ll [new file with mode: 0644]