There are constraints on !pro branch_weights metadata
https://llvm.org/docs/BranchWeightMetadata.html
It needs to be fixed. As I found in the tests, two more instructions may have !prof branch_weights: Invoke and Select. I'm not sure who should fix the documentation.
This patch is to check some of those constraints.
Several patches are needed to land this patch. See D62122, D62123, D62126.