Page MenuHomePhabricator

[ARM] MVE sext costs
ClosedPublic

Authored by dmgreen on Aug 9 2019, 5:08 AM.

Details

Summary

This adds some sext costs for MVE, taken from the approximate length of assembly sequences that we generate.

Diff Detail

Repository
rL LLVM

Event Timeline

dmgreen created this revision.Aug 9 2019, 5:08 AM
ostannard requested changes to this revision.Fri, Aug 16, 5:18 AM
ostannard added inline comments.
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
346 ↗(On Diff #214360)

I think this could do with a comment explaining where the numbers come from. If it's based on the current assembly we generate, are we already generating the optimal sequences, or would these numbers need to change as our code-gen improves?

This revision now requires changes to proceed.Fri, Aug 16, 5:18 AM
dmgreen added inline comments.Fri, Aug 16, 6:43 AM
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
346 ↗(On Diff #214360)

I will add a comment, that sounds like a good idea.

These all came from the codegen tests, mostly in Codegen/Thumb2/mve-sext.ll. I believe the normal code is optimal (I'd be interested if anyone knows of a way to do a v4i8->v4i32 in one instruction. From what I understand you have to use 2).
v2i64's cost more, but "high cost" is not a bad idea for them as we don't have a lot of v2i64 instructions. I don't think that over-estimating there is such a bad thing. The sext are linearised, so cost a lot. The zeroextends are VAND with a constant, which can either come from a constant pool or a VMOV (which we don't generate yet, but soon will hopefully)

dmgreen updated this revision to Diff 215616.Fri, Aug 16, 9:03 AM

Comment and a few extra tests.

This revision is now accepted and ready to land.Sat, Aug 17, 4:56 AM
Closed by commit rL369244: [ARM] MVE sext costs (authored by dmgreen, committed by ). · Explain WhyMon, Aug 19, 2:12 AM
This revision was automatically updated to reflect the committed changes.