This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix instruction selection for ARMISD::CMOV with f16 type
ClosedPublic

Authored by vhscampos on Nov 25 2019, 5:32 AM.

Details

Summary

In the cases where the CMOV (f16) SDNode is used with condition codes
LT, LE, VC or NE, it is successfully selected into a VSEL instruction.

In the remaining cases, however, instruction selection fails since VSEL
does not support other condition codes.

This patch handles such cases by using the single-precision version of
the VMOV instruction.

Diff Detail

Event Timeline

vhscampos created this revision.Nov 25 2019, 5:32 AM
vhscampos updated this revision to Diff 231264.Nov 27 2019, 8:10 AM

Now using a pseudo instruction instead, VMOVHcc, which is lowered into a single-precision VMOV.

dmgreen accepted this revision.Nov 27 2019, 9:44 AM

Yeah I think ran into this on one or two of the MVE cases.

Looks sensible to me, with a minor point about HasFPRegs.

llvm/lib/Target/ARM/ARMInstrVFP.td
2287

If this is ending up as a VMOVS, it can actually be HasFPRegs? I guess it shouldn't matter though, if we are not ever selecting the ARMcmov for an fp16.

The itinerary could also be IIC_fpUNA32, but I don't think they will really be used anywhere or make much of a difference.

If HasFPRegs looks like it will cause problems in any way, then HasFPRegs16 would be fine too.

This revision is now accepted and ready to land.Nov 27 2019, 9:44 AM
vhscampos updated this revision to Diff 231496.Nov 29 2019, 2:00 AM

Require single-precision floating-point registers instead.

vhscampos edited the summary of this revision. (Show Details)Nov 29 2019, 2:01 AM
This revision was automatically updated to reflect the committed changes.