This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] When copying from a gpr32 to an fpr16 reg, convert to fpr32 first
ClosedPublic

Authored by aemerson on Feb 18 2018, 9:36 AM.

Details

Summary

This is a follow on commit to D43310 where we fix the other direction of copy.

For this case, after converting the source from gpr32 -> fpr32, we use a subregister copy, which is essentially what EXTRACT_SUBREG does in SDAG land.

The codegen isn't great at -O0, but I'm not sure what else we can do.

Diff Detail

Repository
rL LLVM

Event Timeline

aemerson created this revision.Feb 18 2018, 9:36 AM
aemerson accepted this revision.Feb 19 2018, 8:25 PM

As stated in PR36345 I'm committing this now to get it into 6.0.

This revision is now accepted and ready to land.Feb 19 2018, 8:25 PM
aemerson closed this revision.Feb 21 2018, 4:00 AM

r325550.

qcolombet added inline comments.Feb 21 2018, 10:50 AM
lib/Target/AArch64/AArch64InstructionSelector.cpp
330

At this point of the pipeline we usually don't write copy from subregs directly.
Could you use EXTRACT_SUBREG instead?

aemerson added inline comments.Feb 21 2018, 11:00 PM
lib/Target/AArch64/AArch64InstructionSelector.cpp
330

That’s what I tried initially, but ExpandPseudos fell over because it expects all EXTRACT_SUBREGs to be eliminated by then. Apparently EXTRACT_SUBREG is normally converted to copies in InstrEmitter during SDISel, so the rest of the pipeline isn’t prepared to deal with it.