This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] [microMIPS] Fix for filling delay slots for PseudoIndirectBranch_MM
ClosedPublic

Authored by mbrkusanin on Feb 21 2019, 7:30 AM.

Details

Summary

Filling a delay slot in 32bit jump instructions with a 16bit instruction can cause issues. According to documentation such an operation is unpredictable. Multiple test from test-suite that fail on microMIPS show this spot as source of failure. This patch adds opcode Mips::PseudoIndirectBranch_MM alongside Mips::PseudoIndirectBranch and other instructions that are expanded to jr instruction and do not allow a 16bit instruction in their delay slots.

Diff Detail

Repository
rL LLVM

Event Timeline

mbrkusanin created this revision.Feb 21 2019, 7:30 AM
sdardis accepted this revision.Feb 21 2019, 11:17 AM

LGTM apart from some minor nits. Please address them before committing.

test/CodeGen/Mips/pseudo-jump-fill.ll
1 ↗(On Diff #187792)

Drop the '--check-prefixes=MIPS'. Also use the update_llc_checks.py script.

2 ↗(On Diff #187792)

Add a quick description of the purpose of this test is, i.e. "Test that the delay slot filler correctly handles indirect branches for microMIPS."

5 ↗(On Diff #187792)

These check lines can be removed, just rely on the update_llc_checks.py script.

16 ↗(On Diff #187792)

Remove the ' preds = %entry,...' here and below.

This revision is now accepted and ready to land.Feb 21 2019, 11:17 AM

Sorry I didn't spot this earlier, but in future please ensure 'llvm-commits' is one of the subscribers when creating a review request for LLVM. If you add it after creating a review request, manually add it and write something in the comments field to trigger Phabricator into sending an email or abandon the review request and re-open it with the relevant -commits list as an initial subscriber.

Posting review requests without the relevant -commits list means that only the subscribers added, subscribers added through Herald rules and initial reviewers will see the request. It is policy that patches are emailed to the relevant list for review[1]. Submitting patches through Phabricator is fine, provided the relevant -commits list is in the subscribers.

Thanks.

[1] http://www.llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch

Addressed review comments.

mbrkusanin marked 5 inline comments as done.Feb 22 2019, 5:01 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2019, 6:55 AM
Herald added a subscriber: jrtc27. · View Herald Transcript