With this patch, the merging feature will be fully functional.
There are two way to turn on profile merging: command line and environment variable. They both share the same mechanism %[0-9]m specifiler in the name pattern. The numeric modifier in the %m specifier specifies the size of the shared profile file pool size. By default %m is equivalent to %1m which means all processes from the same binary share one single profile file.
Example. Do an instrumented clang build with option -fprofile-instr-generate=/tmp/clang_raw_profile_%m and run clang test or do a clang bootstrap, all instrumented binaries such as clang, opt, llc, llvm-profdata etc will dump profile data into its own profile data file.
Running instrumented binary with LLVM_PROFILE_FILE=..._%m will have the same effect.