Page MenuHomePhabricator

[MIPS] Use custom bitcast lowering to avoid excessive instructions
ClosedPublic

Authored by mbrkusanin on Apr 24 2019, 7:43 AM.

Details

Summary

On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1 when
using bitcast i64 to double or an sdc1 and two lw instructions when using
bitcast double to i64. By introducing custom lowering that uses mtc1/mthc1 we
can avoid excessive instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

mbrkusanin created this revision.Apr 24 2019, 7:43 AM
atanasyan accepted this revision.Apr 24 2019, 9:19 AM

LGTM. I would reduce number of tests in the bitcast.ll. I think we can delete all checks with the -mno-ldc1-sdc1 because this option required only to force backend to use the mthc1 instruction.

This revision is now accepted and ready to land.Apr 24 2019, 9:19 AM

Addressed review comments.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2019, 12:45 AM
Herald added a subscriber: jrtc27. · View Herald Transcript