This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Use getRegClassForTypeOnBank() in selectCopy.
ClosedPublic

Authored by aemerson on Feb 1 2018, 6:36 PM.

Details

Summary

There were a lot of test failures (but unknown if they're really indicative of an issue) if I tried to adapt selectCopy to use the helper such that it used GPR64 rather than GPR64all, so I added a parameter to the helper to maintain the existing behavior. It seems reasonable to me to be able to COPY from XZR or SP so my guess is that the existing behavior was correct.

As for why it wasn't using it in the first place, the helper was added after selectCopy() so it was just probably an oversight.

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Feb 1 2018, 6:36 PM
qcolombet accepted this revision.Feb 2 2018, 9:30 AM

LGTM.

One question below.

lib/Target/AArch64/AArch64InstructionSelector.cpp
139 ↗(On Diff #132527)

Would it result in incorrect code if we were to always take the "all" variant?

This revision is now accepted and ready to land.Feb 2 2018, 9:30 AM
aemerson added inline comments.Feb 2 2018, 9:46 AM
lib/Target/AArch64/AArch64InstructionSelector.cpp
139 ↗(On Diff #132527)

I've discussed this with Tim who originally added this function, he thinks that we should probably keep the existing behavior and not force users to use the "all" RC. In practice I don't think it matters too much which one we pick (most of the time).

This revision was automatically updated to reflect the committed changes.