This is an archive of the discontinued LLVM Phabricator instance.

[mips] Optimize materialization of i64 constants.
AbandonedPublic

Authored by vkalintiris on Jan 18 2016, 4:23 AM.

Details

Reviewers
dsanders
Summary

Avoid MipsAnalyzeImmediate pass if the constant fits in an 32-bit
integer. This allows us to generate the same instructions for the
materialization of the same constants regardless the width of their
type.

Depends on D16221.

Diff Detail

Event Timeline

vkalintiris retitled this revision from to [mips] Optimize materialization of i64 constants..
vkalintiris updated this object.
vkalintiris added a reviewer: dsanders.
vkalintiris added a subscriber: llvm-commits.
dsanders requested changes to this revision.Feb 3 2016, 7:49 AM
dsanders edited edge metadata.
dsanders added inline comments.
lib/Target/Mips/MipsInstrInfo.td
2056

The bug is probably the use of 'imm' here. I think you want immSExt32.

test/CodeGen/Mips/cmov.ll
499–500

This constant now takes two instructions to materialize but it used to only take one.

test/CodeGen/Mips/load-store-left-right.ll
157–159

This isn't the same constant as the previous code.
New: 0xffff_ffff_ffff_ffff
Old: 0x0000_0000_ffff_ffff

test/MC/Mips/sext_64_32.ll
18–20

This is a nop now because the mask is 0xffff_ffff_ffff_ffff which is the case because lui is sign-extended. It's not clear from the test but I suspect it used to be 0x0000_0000_ffff_ffff which is best done with the dsll32/dsrl32 pair the old test is hinting at.

This revision now requires changes to proceed.Feb 3 2016, 7:49 AM
vkalintiris abandoned this revision.Jun 5 2016, 10:40 AM