This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] [microMIPS] Fix PseudoMTLOHI_MM matching and expansion
ClosedPublic

Authored by mbrkusanin on Mar 11 2019, 3:35 AM.

Details

Summary

On micromips MipsMTLOHI is always matched to PseudoMTLOHI_DSP regardless of
+dsp argument. This patch checks is HasDSP predicate is present for
PseudoMTLOHI_DSP so PseudoMTLOHI_MM can be matched when appropriate.

Add expansion of PseudoMTLOHI_MM instruction into a mtlo/mthi pair.

Diff Detail

Event Timeline

mbrkusanin created this revision.Mar 11 2019, 3:35 AM

I think we can join D59203 and D59204 patches. Now LLVM incorrectly generates dsp instructions in all cases. After applying D59203 it starts to use PseudoMTLOHI_MM, but test case from the D59204 crashes llc. And after applying the D59204 everything work okay. Let's do an atomic change.

mbrkusanin retitled this revision from [MIPS] [microMIPS] Fix PseudoMTLOHI matching to [MIPS] [microMIPS] Fix PseudoMTLOHI_MM matching and expansion.
mbrkusanin edited the summary of this revision. (Show Details)

Combined with it's child revision D59204.

atanasyan accepted this revision.Mar 11 2019, 6:45 AM

We can drop micromips-pseudo-mtlohi-match.ll and keep the micromips-pseudo-mtlohi-expand.ll only because this test checks all that is necessary. With this modification the patch is LGTM.

This revision is now accepted and ready to land.Mar 11 2019, 6:45 AM

Removed micromips-pseudo-mtlohi-match.ll

Removed micromips 32r6 RUN: line. MTHI and MTLO were removed from micromips R6 so this test is unnecessary.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2019, 4:03 AM
Herald added a subscriber: jrtc27. · View Herald Transcript