[llvm] Fix: Distinguish CFI Metadata Checks in MergeFunctions Pass (PR #65963)

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 07:51:52 PDT 2023


dexonsmith wrote:

Before giving more low-level feedback, I'm a bit worried this is change is too broad.

> This diff fixes an issue in the MergeFunctions pass where two different Control Flow Integrity (CFI) metadata checks were incorrectly considered identical. These merges would lead to runtime violations down the line as two separate objects contained a single destructor which itself contained checks for only one of the objects.

Can you clarify whether functions should be excluded from merging if the CFI metadata referenced by `llvm.type.test` matches exactly, or only if they are different? (What if they have different identities (`distinct`) but are structurally equivalent?)

Also, why are you restricting all metadata-as-value arguments, instead of just `llvm.type.test` intrinsics?

https://github.com/llvm/llvm-project/pull/65963


More information about the llvm-commits mailing list