[Assignment Tracking][NFC] Avoid doing some work when maps have same keys
authorOCHyams <orlando.hyams@sony.com>
Thu, 23 Feb 2023 15:50:51 +0000 (15:50 +0000)
committerOCHyams <orlando.hyams@sony.com>
Thu, 23 Feb 2023 16:16:02 +0000 (16:16 +0000)
commit258c806b41251f66043a7d8636deae1a649fe6cb
tree68bca808127ab45eeffd2ebe1b3b37baa10c7e85
parent68b56e3a74706b1a63a38b8f45c50b10c82ba640
[Assignment Tracking][NFC] Avoid doing some work when maps have same keys

Where the new checks have been added, `SymmetricDifference` - still being built
- contains entries for variables present in `A` and not in `B`.  If
`SymmetricDifference` is empty at this point it means the variables (map keys)
in `A` are a subset of those in `B`, so if `A` and `B` are the same size then
we know they're identical.

This reduces the number of instructions retired building some of the CTMark
projects in a ReleaseLTO-g configuration (geomean change -0.05% with the best
improvement being -0.24% for tramp3d-v4)

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D144621
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp