This came up in This came up in
https://reviews.llvm.org/D146776#inline-1489091 and is slightly related
to https://reviews.llvm.org/D153855. In both patches, there is the
observation that some modifications of the module should not invalidate
analysis, such as when adding a declaration or some metadata the won't
be used when compiling the current module.
This patch implements the suggestion that we should ignore globals that have
the llvm. prefix when calculating the module hash.
I've been meaning to write some unittests that specifically just check (in)equality of llvm::StructuralHash of two modules so we can avoid doing that. Going through a pass manager shouldn't be necessary. I can do that, or if you have time you can start that :)