This is an archive of the discontinued LLVM Phabricator instance.

[MIPS GlobalISel] Select addiu
ClosedPublic

Authored by Petar.Avramovic on Nov 13 2019, 7:58 AM.

Details

Summary

Introduce IntImmLeaf version of PatLeaf immSExt16 for 32-bit immediates.
Change immSExt16 with imm32SExt16 for addiu.
This keeps same behavior for SDAG and allows for GlobalISel selectImpl
to select 'G_CONSTANT imm' + G_ADD into ADDIu when 32-bit imm satisfies
imm32SExt16 predicate: sign extending 16 low bits of imm is equal to imm.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2019, 7:58 AM
atanasyan accepted this revision.Nov 13 2019, 10:53 AM

LGTM

llvm/lib/Target/Mips/MipsInstrInfo.td
1268

It's unrelated to this patch but probably this comment should say about "8-bit sign extended".

This revision is now accepted and ready to land.Nov 13 2019, 10:53 AM
This revision was automatically updated to reflect the committed changes.