]> granicus.if.org Git - llvm/commit
[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)
commit0edfaf6dd292069ccffe888f89feb1471df43c8a
tree94fab36c6b22fa894d8f696cd617806094a13e42
parent899d0e64382aeaa8bb18af4ba11ae68e222eb587
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365660 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/CodeExtractor.cpp
test/Transforms/CodeExtractor/live_shrink_multiple.ll
test/Transforms/HotColdSplit/sink-multiple-bitcasts-of-allocas-pr42451.ll [new file with mode: 0644]