This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Bail out on PHIs in catchswitch BBs
ClosedPublic

Authored by aheejin on Jan 12 2022, 3:38 PM.

Details

Summary

In the process of rewriting allocas and phis that use them, the SROA
pass can try to insert a non-PHI instruction by calling
getFirstInsertionPt(), which is not possible in a catchswitch BB. This
CL makes we bail out on these cases.

Diff Detail

Event Timeline

aheejin created this revision.Jan 12 2022, 3:38 PM
aheejin requested review of this revision.Jan 12 2022, 3:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2022, 3:38 PM
aheejin edited the summary of this revision. (Show Details)Jan 12 2022, 3:39 PM
lebedev.ri requested changes to this revision.Jan 13 2022, 12:54 AM
lebedev.ri added a subscriber: lebedev.ri.
lebedev.ri added inline comments.
llvm/test/Transforms/SROA/phi-catchswitch.ll
2

There is no run line in this test, so it doesn't actually test anything.

This revision now requires changes to proceed.Jan 13 2022, 12:54 AM
aheejin updated this revision to Diff 399759.Jan 13 2022, 1:05 PM

Add RUN line + checks

aheejin marked an inline comment as done.Jan 13 2022, 1:06 PM
aheejin added inline comments.
llvm/test/Transforms/SROA/phi-catchswitch.ll
2

Oh right.. Added it, thanks.

aheejin updated this revision to Diff 399785.Jan 13 2022, 2:14 PM
aheejin marked an inline comment as done.

Add CHECK-LABEL

aheejin updated this revision to Diff 399849.Jan 13 2022, 5:19 PM

Add preds comments to test

aheejin edited the summary of this revision. (Show Details)Jan 14 2022, 11:41 AM
dschuff accepted this revision.Jan 14 2022, 2:47 PM

Thanks for fixing this.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 14 2022, 2:55 PM
This revision was automatically updated to reflect the committed changes.