This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] Fix for selecting of DINS/INS instruction
ClosedPublic

Authored by spetrovic on May 31 2017, 8:58 AM.

Details

Summary

This patch adds one more condition in selection DINS/INS instruction, which fixes MultiSource/Applications/JM/ldecod/ for mips32r2 (and mips64r2 n32 abi).

Diff Detail

Repository
rL LLVM

Event Timeline

spetrovic created this revision.May 31 2017, 8:58 AM
sdardis edited edge metadata.Jun 1 2017, 3:13 AM

Test case?

spetrovic updated this revision to Diff 101204.Jun 2 2017, 7:12 AM

This patch needs a better description of what the issue it's fixing is, and how it's fixing it. Further comments inlined.

lib/Target/Mips/MipsISelLowering.cpp
855–856 ↗(On Diff #101204)

This requires a comment explaining that we don't produce inserts if the constant operand to the 'or' overlaps with the constant operand of the 'and', and why.

(Provided my reasoning about this patch is correct.)

test/CodeGen/Mips/dins.ll
4 ↗(On Diff #101204)

The parameters here are wrong, it should be -target-abi=n32 if the check prefix is correct. I'm presuming you meant n32 as the testing already covers n64.

Second issue: is there anything specific to testing n32 codegen that separates it from n64 codegen?

80 ↗(On Diff #101204)

Remove 'local_unnamed_addr #0' from the define here, it's unnecessary.

92–97 ↗(On Diff #101204)

Can you reformat this to the same formatting as the checks on line 60-68? I.e. all assembly starts on the same column?

spetrovic updated this revision to Diff 101733.Jun 7 2017, 7:19 AM
spetrovic marked 4 inline comments as done.
spetrovic added inline comments.Jun 7 2017, 7:22 AM
test/CodeGen/Mips/dins.ll
4 ↗(On Diff #101204)

I added n32 testing because the ldecod from test-suite was failing only for n32, but not on n64, although, for this test, the same code is generated for n32 and n64.

The patch for which this fix was made (https://reviews.llvm.org/D31465) introduced problems in the Chrome V8 build. After applying this fix all relevant tests pass, so it would be useful if it was committed as soon as possible.

sdardis accepted this revision.Jun 20 2017, 5:45 AM

LGTM.

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