This is an archive of the discontinued LLVM Phabricator instance.

[MachineSinking, RFC] Sink insert_subreg, subreg_to_reg, and reg_sequence instructions
ClosedPublic

Authored by wmi on Aug 5 2016, 9:57 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi updated this revision to Diff 66968.Aug 5 2016, 9:57 AM
wmi retitled this revision from to [MachineSinking, RFC] Sink insert_subreg, subreg_to_reg, and reg_sequence instructions .
wmi updated this object.
wmi added reviewers: qcolombet, MatzeB.
wmi set the repository for this revision to rL LLVM.
wmi added subscribers: llvm-commits, davidxl.
wmi updated this revision to Diff 67264.Aug 8 2016, 5:50 PM

Remove the check for all architectures and see if there are performance problems.

wmi added a comment.Aug 10 2016, 10:12 AM

Quentin, I will go ahead to checkin the patch and see its peformance impact as you suggested in PR28852 and want to get an explicit approval. Although I only have x86 platforms and only did performance evaluation on them, I remove the check for all the architectures expecting to catch more potential performance problems. I am prepared to analyze those performance problems found on other architectures.

qcolombet accepted this revision.Aug 11 2016, 9:23 AM
qcolombet edited edge metadata.

Hi Wei,

SGTM.

Cheers,
-Quentin

This revision is now accepted and ready to land.Aug 11 2016, 9:23 AM
qcolombet added inline comments.Aug 11 2016, 9:23 AM
test/CodeGen/X86/MachineSink-SubReg.ll
26 ↗(On Diff #67264)

use opt -instnamer

This revision was automatically updated to reflect the committed changes.