This is an archive of the discontinued LLVM Phabricator instance.

[GlobalMerge] Ensure that the MustKeepGlobalVariables has all globals from each landingpad clause.
ClosedPublic

Authored by stefanp on Jun 21 2022, 9:56 AM.

Details

Summary

The filter clause in the landingpad may not have a GlobalVariable operand.
It may instead have a ConstantArray of operands and each operand within this
ConstantArray should also be checked to see if it is a GlobalVariable.

This patch add the check for the ConstantArray as well as a debug message that
outputs the contents of MustKeepGlobalVariables.

Diff Detail

Event Timeline

stefanp created this revision.Jun 21 2022, 9:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 9:56 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
stefanp requested review of this revision.Jun 21 2022, 9:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 9:56 AM
stefanp added reviewers: amyk, Restricted Project, lattner.Jun 21 2022, 10:00 AM
lei accepted this revision as: lei.Jun 22 2022, 7:09 AM

LGTM
Thx!

This revision is now accepted and ready to land.Jun 22 2022, 7:09 AM
amyk accepted this revision as: amyk.Jun 22 2022, 9:58 AM

Patch looks good to me, too. Thanks Stefan.

llvm/lib/CodeGen/GlobalMerge.cpp
611

nit: Unnecessary space?

scui accepted this revision.Jun 23 2022, 11:47 AM

LGTM. Thanks!

stefanp updated this revision to Diff 441158.Jun 29 2022, 1:54 PM

Rebased to top of trunk.
Removed the extra space.

This revision was landed with ongoing or failed builds.Jun 29 2022, 1:55 PM
This revision was automatically updated to reflect the committed changes.