[PATCH] D37902: [CodeExtractor] Fix multiple bugs under certain shape of extracted region

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 07:06:58 PDT 2017


myhsu created this revision.
Herald added a subscriber: mgorny.

This revision consist of two part: exitStub bug and DomTree update problem
For the exitStub bug. 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

For the DomTree update problem. Currently it use GenericDominatorTree::splitBlock(GenericDominatorTree::Split underlying) to update DomTree. However, the API has several restrictions such as the NewBB can only has one successor and need to have predecessor, which is not generic enough and fails in some cases, like the first BB in the extracted region is the entry block. For the sake of not adding extra conditions for candidates of extracted region, my solution is updating the DomTree manually.


https://reviews.llvm.org/D37902

Files:
  lib/Transforms/Utils/CodeExtractor.cpp
  unittests/Transforms/Utils/CMakeLists.txt
  unittests/Transforms/Utils/CodeExtractor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37902.115402.patch
Type: text/x-patch
Size: 8379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170915/2eb9bbd0/attachment.bin>


More information about the llvm-commits mailing list