This is an archive of the discontinued LLVM Phabricator instance.

[WinEH] Add a funclet layout pass
ClosedPublic

Authored by majnemer on Sep 17 2015, 1:30 PM.

Details

Summary

Windows EH funclets need to be contiguous. The FuncletLayout pass will
ensure that the funclets are together and begin with a funclet entry MBB.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 35030.Sep 17 2015, 1:30 PM
majnemer retitled this revision from to [WinEH] Add a funclet layout pass.
majnemer updated this object.
majnemer added a reviewer: rnk.
majnemer added a subscriber: llvm-commits.
rnk accepted this revision.Sep 17 2015, 1:35 PM
rnk edited edge metadata.

lgtm

lib/CodeGen/FuncletLayout.cpp
69 ↗(On Diff #35030)

You can do:

if (!F.getMMI().hasEHFunclets())
  return false;
72 ↗(On Diff #35030)

MBB.isEHFuncletEntry()

76 ↗(On Diff #35030)

Now you can assert !empty

test/CodeGen/X86/funclet-layout.ll
31 ↗(On Diff #35030)

s/is contains/contains/

32 ↗(On Diff #35030)

Maybe throw in

CHECK-LABEL: _f:
34 ↗(On Diff #35030)
CHECK: retl
35 ↗(On Diff #35030)

ditto

This revision is now accepted and ready to land.Sep 17 2015, 1:35 PM
This revision was automatically updated to reflect the committed changes.