]> granicus.if.org Git - llvm/commit
[CodeExtractor] Fix multiple bugs under certain shape of extracted region
authorJakub Kuderski <kubakuderski@gmail.com>
Fri, 6 Oct 2017 03:37:06 +0000 (03:37 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Fri, 6 Oct 2017 03:37:06 +0000 (03:37 +0000)
commitbcebc161537b0c9b222e386fe475bc7a5a839b14
treec501dcd7a6ea2a65f5121beffd9fab0501b0eb0c
parent9d89f00c5e6b00b452a5aebf78c1c8ddc3f917bd
[CodeExtractor] Fix multiple bugs under certain shape of extracted region

Summary:
If the extracted region has multiple exported data flows toward the same BB which is not included in the region, correct resotre instructions and PHI nodes won't be generated inside the exitStub. The solution is simply put the restore instructions right after the definition of output values instead of putting in exitStub.
Unittest for this bug is included.

Author: myhsu

Reviewers: chandlerc, davide, lattner, silvas, davidxl, wmi, kuhar

Subscribers: dberlin, kuhar, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315041 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/CodeExtractor.cpp
unittests/Transforms/Utils/CMakeLists.txt
unittests/Transforms/Utils/CodeExtractor.cpp [new file with mode: 0644]