This is an archive of the discontinued LLVM Phabricator instance.

[mips][msa] Pattern match the splat.d instruction
ClosedPublic

Authored by smaksimovic on Apr 16 2018, 5:48 AM.

Details

Summary

Introduced a new pattern for matching splat.d explicitly.

Both splat.d and splati.d can now be generated from the @llvm.mips.splat.d
intrinsic depending on whether an immediate value has been passed.

Diff Detail

Event Timeline

smaksimovic created this revision.Apr 16 2018, 5:48 AM
sdardis accepted this revision.Apr 30 2018, 6:06 AM

LGTM. Some minor nits inlined.

lib/Target/Mips/MipsMSAInstrInfo.td
195–202

Nit on the formatting here:

def vsplati64_splat_d : PatFrag<(ops node:$e0),
                                (v2i64 (bitconvert
                                         (v4i32 (and
                                           (v4i32 (build_vector node:$e0,
                                                                node:$e0,
                                                                node:$e0,
                                                                node:$e0)),
                                           vsplati64_imm_eq_1))))>;
lib/Target/Mips/MipsSEISelLowering.cpp
1346

In case of the index being passed as an immediate value....

test/CodeGen/Mips/msa/3r_splat.ll
107

This line can be dropped.

123

This line can be dropped.

This revision is now accepted and ready to land.Apr 30 2018, 6:06 AM
This revision was automatically updated to reflect the committed changes.