Add `--sort` to emit remarks in sorted order and `--dedupe` to deduplicate identical remarks. Only if these options are requested, remarks need to be buffered into a sorted map before emission. Pull Request: https://github.com/llvm/llvm-project/pull/187338