This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix crash due to improper catchswitch handling
AbandonedPublic

Authored by clin1 on Apr 19 2021, 2:43 PM.

Details

Reviewers
fhahn
lebedev.ri
Summary

If a phi in a catchswitch block is turned into a bitcast, this will break the rule that the catchswitch must be the first (and the last) non-phi instruction. Suppress the transformation in this case.

Diff Detail

Event Timeline

clin1 created this revision.Apr 19 2021, 2:43 PM
clin1 requested review of this revision.Apr 19 2021, 2:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 2:43 PM
clin1 updated this revision to Diff 338667.Apr 19 2021, 4:22 PM

fixed case in variable name

lebedev.ri requested changes to this revision.Apr 20 2021, 12:29 AM
lebedev.ri added a subscriber: lebedev.ri.

Please update patch description to actually describe the patch, not repeat what it does.

This revision now requires changes to proceed.Apr 20 2021, 12:29 AM
clin1 retitled this revision from Suppress phi->bitcast transformation in InstCombine for catchswitch blocks. to [InstCombine] Fix crash due to improper catchswitch handling.Apr 20 2021, 12:24 PM
clin1 edited the summary of this revision. (Show Details)
lebedev.ri accepted this revision.Apr 21 2021, 1:57 PM

LG

llvm/test/Transforms/InstCombine/phi-catchswitch.ll
2

Please use ./utils/update_test_checks.py

This revision is now accepted and ready to land.Apr 21 2021, 1:57 PM
clin1 added a comment.Apr 21 2021, 9:39 PM

Thanks for the review comments! Could I please ask someone for help making the commit? I don't have write access.

Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 11:20 AM