This is an archive of the discontinued LLVM Phabricator instance.

[mips] Make isel select the correct DEXT variant up front.
ClosedPublic

Authored by dsanders on Feb 2 2016, 9:13 AM.

Details

Summary

Previously, it would always select DEXT and substitute any invalid matches
for DEXTU/DEXTM during MipsMCCodeEmitter::encodeInstruction(). This works
but causes problems when adding range checked immediates to IAS.

Now isel selects the correct variant up front.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 46663.Feb 2 2016, 9:13 AM
dsanders retitled this revision from to [mips] Make isel select the correct DEXT variant up front..
dsanders updated this object.
dsanders added a reviewer: vkalintiris.
dsanders added a subscriber: llvm-commits.
vkalintiris accepted this revision.Feb 29 2016, 3:28 AM
vkalintiris edited edge metadata.

LGTM, with a small change as described in the in-line comment.

lib/Target/Mips/MipsInstrInfo.td
835–843

The names imply that we add a constant to the zext'd value, but we perform a subtraction instead.

This revision is now accepted and ready to land.Feb 29 2016, 3:28 AM
dsanders added inline comments.Feb 29 2016, 4:01 AM
lib/Target/Mips/MipsInstrInfo.td
835–843

The intent is to describe the ranges 1..32, 32..63, and 33..64 which are uimm5's with an offset added. The reason the code performs a subtraction is that the predicate must undo the offset so that we can test for a normal uimm5.

vkalintiris added inline comments.Feb 29 2016, 4:53 AM
lib/Target/Mips/MipsInstrInfo.td
835–843

Ok, I was trying to think of a better name such as immZExt5Offset32, but I don't like that either. You can go ahead and commit this then.

dsanders updated this revision to Diff 49367.Feb 29 2016, 6:58 AM
dsanders edited edge metadata.

Rebase before commit

dsanders closed this revision.Feb 29 2016, 7:31 AM