Page MenuHomePhabricator

[mips] Pick the right variant of DINS upfront and enable target instruction verification
ClosedPublic

Authored by sdardis on Jun 29 2017, 3:26 AM.

Details

Summary

This patch complements D16810 "[mips] Make isel select the correct DEXT variant
up front.". Now ISel picks the right variant of DINS, so now there is no need
to replace DINS with the appropriate variant during
MipsMCCodeEmitter::encodeInstruction().

This patch also enables target specific instruction verification for ins, dins,
dinsm, dinsu, ext, dext, dextm, dextu. These instructions have constraints that
are checked when generating MipsISD::Ins and MipsISD::Ext nodes, but these
constraints are not checked during instruction selection. Adding machine
verification should catch outstanding cases.

Finally, correct a bug that instruction verification uncovered, where the
position operand of a DINSU generated during lowering was being silently
and accidently corrected to the correct value.

Event Timeline

sdardis created this revision.Jun 29 2017, 3:26 AM
sdardis planned changes to this revision.Jun 29 2017, 4:03 AM

I have a stack of patches relating to this area, and I've just realized I've exposed a bug with this patch that is fixed in a later patch. I'll combine the patches, as ugly as it is.

sdardis updated this revision to Diff 104648.Jun 29 2017, 7:43 AM
sdardis retitled this revision from [mips] Pick the right variant of DINS upfront. to [mips] Pick the right variant of DINS upfront and enable target instruction verification.
sdardis edited the summary of this revision. (Show Details)

Updated the patch to perform instruction verification.
Fix the bug in the DAG-to-DAG transform that introduced an DINSU node with illegal operands that was being silently corrected.

sdardis updated this revision to Diff 104836.Jun 30 2017, 3:15 AM

Update the diff to a buildable one.

slthakur accepted this revision.Jul 3 2017, 5:45 AM

LGTM

This revision is now accepted and ready to land.Jul 3 2017, 5:45 AM
This revision was automatically updated to reflect the committed changes.