This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][TTI] Set the cost of XTN to 1 for 2xi64 (to 2xi32) and 8xi16 (to8xi8).
AbandonedPublic

Authored by mingmingl on Aug 29 2022, 8:49 AM.

Details

Reviewers
None
Summary

From [1], XTN is used for {v8i16->v8i8, v4i32->v4i16, v2i64->v2i32}.
Without this, an IR instruction like trunc <8 x i16> %v to <8 x i8> is considered free and might be sinked to other basic blocks. As a result, the sinked 'trunc' is in a different basic block with its (usually not-free) vector operand and misses the chance to be combined during instruction selection. (examples in [2])

[1] https://github.com/llvm/llvm-project/blob/813ae2871d71f32cce46768e63185cd64651f6e9/llvm/lib/Target/AArch64/AArch64InstrInfo.td#L4472
[2] examples

Diff Detail

Event Timeline

mingmingl created this revision.Aug 29 2022, 8:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 8:49 AM
mingmingl requested review of this revision.Aug 29 2022, 8:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 8:49 AM
mingmingl abandoned this revision.Aug 29 2022, 10:55 AM

a duplicate of another reviewed revision (that was created by a mistaken operation), so abandon this.