This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Disable Global and Fast ISel at -O0 if the SVE feature is found
AbandonedPublic

Authored by david-arm on Jun 8 2020, 2:32 AM.

Details

Summary

At the moment we use Global ISel by default at -O0, however it is
currently not capable of dealing with scalable vectors for two
reasons:

  1. The register banks know nothing about SVE registers.
  2. The LLT (Low Level Type) class knows nothing about scalable

vectors.

For now, the easiest way to avoid users hitting issues when using
the SVE ACLE is to disable Global ISel. In addition, we need to
also disable Fast ISel, since it doesn't just work for scalable
vectors at the moment either.

I've added a couple of RUN lines to existing SVE tests to ensure
we can compile at -O0.

Diff Detail

Event Timeline

david-arm created this revision.Jun 8 2020, 2:32 AM
Herald added a reviewer: efriedma. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
david-arm added a subscriber: aemerson.

Hi @aemerson, do you know if there are any plans to add scalable vector support to global isel for AArch64?

Hi @aemerson, do you know if there are any plans to add scalable vector support to global isel for AArch64?

Hi Greg. I don't have plans personally to work on scalable vector support for GlobalISel, but it's a good idea for someone to do so. Bailing out of both fastisel and GISel will result in SDag being used and hit -O0 compile times significantly.

Maybe a better way would be to fall back to SelectionDAG if any scalable types are found in the IR during translation. A custom "target wants to fall back" hook might be wanted here to make it cleaner. That way, -fsve or whatever it is to enable SVE won't unnecessarily use SelectionDAG at -O0 unless there are actual scalable types present.

Hi @aemerson, it's Gregg (with two g's by the way). I'm afraid I can't provide any sausage rolls at this time, but I've certainly found a way to add a hook as you suggested!

david-arm abandoned this revision.Jun 10 2020, 5:32 AM

I'll push a new patch soon that adds a hook to fall back to DAG ISel.