In https://llvm.org/bugs/show_bug.cgi?id=28852, we saw a testcase for which machineSinking was blocked by subreg_to_reg so high cost operation cannot be moved to cold place.
The limitation about "insert_subreg, subreg_to_reg, and reg_sequence" was to make them close to the source and make them easier to coalesce. Will the coalesce indicated here happen at register coalescing or register allocation? Is the limitation still valid considering it was added at 2010 and register coalescing and allocation has gone through a lot of changes?
I did some testing to remove the restriction on x86, for spec2000, I got 1% improvement for three benchmarks: gap, vortex, perlbmk. no regressions seen.
For internal benchmarks, I got 2% improvement for one benchmark and 1% for another. no regressions seen.
use opt -instnamer