[GlobalMerge] Ensure that the MustKeepGlobalVariables has all globals from each landi...
authorStefan Pintilie <stefanp@ca.ibm.com>
Wed, 29 Jun 2022 19:33:08 +0000 (14:33 -0500)
committerStefan Pintilie <stefanp@ca.ibm.com>
Wed, 29 Jun 2022 20:55:47 +0000 (15:55 -0500)
commite50a8c8435e0c80e3b9881f58e335305d1c1e366
tree7643c3b956250a266a292b736ee47f25122fe192
parentc9be90986f1ad99c7e6fe59ab79e0c6a2cdc338b
[GlobalMerge] Ensure that the MustKeepGlobalVariables has all globals from each landingpad clause.

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.

Reviewed By: lei, amyk, scui

Differential Revision: https://reviews.llvm.org/D128287
llvm/lib/CodeGen/GlobalMerge.cpp
llvm/test/Transforms/GlobalMerge/eh-filter.ll [new file with mode: 0644]