Revert "Move function to obtain branch weights into the BranchInst class. NFC."

This reverts commit r223784 and copies the 'ExtractBranchMetadata' to CodeGenPrepare.