This is an archive of the discontinued LLVM Phabricator instance.

[AVX-512] Use AVX512 feature instead of VLX to determine whether to use extended 128/256-bit register classes for addRegisterClass.
AbandonedPublic

Authored by craig.topper on Oct 3 2016, 8:56 PM.

Details

Reviewers
delena
Summary

Hopefully now that we are able to spill XMM16-31 and YMM16-31 without VLX we should be able to use the larger register classes and rely on individual instruction register class constraints to control register selection.

This should allow some instructions that read or write 128/256-bit registers without VLX to use extended registers. For example VEXTRACTF32x4.

Ideally we'd just always pass the extended register classes regardless of AVX512 mode, but that fails machine verifier when VEX encoded 128-bit and 256-bit move instructions are emitted from copyPhysReg with the larger register class.

Diff Detail

Event Timeline

craig.topper retitled this revision from to [AVX-512] Use AVX512 feature instead of VLX to determine whether to use extended 128/256-bit register classes for addRegisterClass..
craig.topper updated this object.
craig.topper added a reviewer: delena.
craig.topper added a subscriber: llvm-commits.
delena edited edge metadata.Oct 4 2016, 11:15 PM

You, probably, do the right thing, but the changed test does not explore the source change. May be you need to write a test with instructions like VPMOVDB to show code improvements?

craig.topper edited edge metadata.

Here's a new version with a test case that shows using the extended register with vpmovdb.

While doing this I discovered that the current code for getLargestLegalSuperClass has a bug in it that was responsible for xmm16 being used and spilled without VLX enabled. I considered fixing that bug separately from this, but figured that was unnecessary churn.

Oops the new test didn't make it into the previous patch. This should have it.

Here's a new version with a test case that shows using the extended register with vpmovdb.

I went through the test and didn't see any extended xmm/ymm in the code.

This review is uncompleted. Are you going to change the test or I'm missing something?

craig.topper planned changes to this revision.Oct 25 2016, 10:51 PM

Sorry about that. I had a working test case and I was trying to see what icc and gcc do with it as well. But now I think I lost the test case. I'll try to get back to it eventually.

craig.topper abandoned this revision.Mar 2 2017, 11:44 PM