[PATCH] D13274: [WinEH] Clone funclets with multiple parents

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 15:08:32 PDT 2015


andrew.w.kaylor created this revision.
andrew.w.kaylor added reviewers: JosephTremoulet, rnk, majnemer.
andrew.w.kaylor added a subscriber: llvm-commits.
andrew.w.kaylor set the repository for this revision to rL LLVM.

This patch clones the entire body of any funclet with more than one parent to avoid inconsistencies in the funclet hierarchy.  Paths through the now multiple copies of the funclet which return to a funclet other than their intended parent are terminated with unreachable instructions.

Note that it was necessary to modify the wineh-demotion.ll and wineh-no-demotion.ll tests for this patch.  The IR in the wineh-demotion.ll test appears to have been invalid and I just cleaned it up, attempting to preserve the intent of the test.

The wineh-no-demotion.ll test is directly impacted by the changes in this patch.  Following the logic of the new funclet cloning algorithm for two of the test cases in this file results in multiple identical funclets with a unreachable terminator.  This seems bad, but it wasn't clear to me whether it was preferable to not clone funclets in a situation like this given that the test cases in wineh-cloning.ll which were created in advance for this new cloning scenario include cleanup pads with unreachable terminators and seem to expect them to be cloned.

Repository:
  rL LLVM

http://reviews.llvm.org/D13274

Files:
  include/llvm/Transforms/Utils/Local.h
  lib/CodeGen/WinEHPrepare.cpp
  lib/Transforms/Utils/Local.cpp
  test/CodeGen/WinEH/wineh-cloning.ll
  test/CodeGen/WinEH/wineh-demotion.ll
  test/CodeGen/WinEH/wineh-no-demotion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13274.36042.patch
Type: text/x-patch
Size: 29693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150929/b4fcbb6a/attachment.bin>


More information about the llvm-commits mailing list