Skip to content

Commit f041338

Browse files
committed
[X86][Costmodel] Add SSE2 sub-128bit vXi32/f32 stride 2 interleaved store costs
Differential Revision: https://reviews.llvm.org/D111941
1 parent c850d5c commit f041338

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5325,7 +5325,6 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCost(
53255325
{2, MVT::v16i16, 4}, // interleave 2 x 16i16 into 32i16 (and store)
53265326
{2, MVT::v32i16, 8}, // interleave 2 x 32i16 into 64i16 (and store)
53275327

5328-
{2, MVT::v2i32, 1}, // interleave 2 x 2i32 into 4i32 (and store)
53295328
{2, MVT::v4i32, 2}, // interleave 2 x 4i32 into 8i32 (and store)
53305329
{2, MVT::v8i32, 4}, // interleave 2 x 8i32 into 16i32 (and store)
53315330
{2, MVT::v16i32, 8}, // interleave 2 x 16i32 into 32i32 (and store)
@@ -5412,6 +5411,8 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCost(
54125411

54135412
{2, MVT::v2i16, 1}, // interleave 2 x 2i16 into 4i16 (and store)
54145413
{2, MVT::v4i16, 1}, // interleave 2 x 4i16 into 8i16 (and store)
5414+
5415+
{2, MVT::v2i32, 1}, // interleave 2 x 2i32 into 4i32 (and store)
54155416
};
54165417

54175418
if (Opcode == Instruction::Load) {

llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ target triple = "x86_64-unknown-linux-gnu"
1313
; CHECK: LV: Checking a loop in "test"
1414
;
1515
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store float %v1, float* %out1, align 4
16-
; SSE2: LV: Found an estimated cost of 6 for VF 2 For instruction: store float %v1, float* %out1, align 4
16+
; SSE2: LV: Found an estimated cost of 2 for VF 2 For instruction: store float %v1, float* %out1, align 4
1717
; SSE2: LV: Found an estimated cost of 14 for VF 4 For instruction: store float %v1, float* %out1, align 4
1818
; SSE2: LV: Found an estimated cost of 28 for VF 8 For instruction: store float %v1, float* %out1, align 4
1919
; SSE2: LV: Found an estimated cost of 56 for VF 16 For instruction: store float %v1, float* %out1, align 4
2020
;
2121
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store float %v1, float* %out1, align 4
22-
; AVX1: LV: Found an estimated cost of 6 for VF 2 For instruction: store float %v1, float* %out1, align 4
22+
; AVX1: LV: Found an estimated cost of 2 for VF 2 For instruction: store float %v1, float* %out1, align 4
2323
; AVX1: LV: Found an estimated cost of 15 for VF 4 For instruction: store float %v1, float* %out1, align 4
2424
; AVX1: LV: Found an estimated cost of 38 for VF 8 For instruction: store float %v1, float* %out1, align 4
2525
; AVX1: LV: Found an estimated cost of 76 for VF 16 For instruction: store float %v1, float* %out1, align 4

llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ target triple = "x86_64-unknown-linux-gnu"
1313
; CHECK: LV: Checking a loop in "test"
1414
;
1515
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: store i32 %v1, i32* %out1, align 4
16-
; SSE2: LV: Found an estimated cost of 14 for VF 2 For instruction: store i32 %v1, i32* %out1, align 4
16+
; SSE2: LV: Found an estimated cost of 2 for VF 2 For instruction: store i32 %v1, i32* %out1, align 4
1717
; SSE2: LV: Found an estimated cost of 30 for VF 4 For instruction: store i32 %v1, i32* %out1, align 4
1818
; SSE2: LV: Found an estimated cost of 60 for VF 8 For instruction: store i32 %v1, i32* %out1, align 4
1919
; SSE2: LV: Found an estimated cost of 120 for VF 16 For instruction: store i32 %v1, i32* %out1, align 4
2020
;
2121
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: store i32 %v1, i32* %out1, align 4
22-
; AVX1: LV: Found an estimated cost of 9 for VF 2 For instruction: store i32 %v1, i32* %out1, align 4
22+
; AVX1: LV: Found an estimated cost of 2 for VF 2 For instruction: store i32 %v1, i32* %out1, align 4
2323
; AVX1: LV: Found an estimated cost of 19 for VF 4 For instruction: store i32 %v1, i32* %out1, align 4
2424
; AVX1: LV: Found an estimated cost of 46 for VF 8 For instruction: store i32 %v1, i32* %out1, align 4
2525
; AVX1: LV: Found an estimated cost of 92 for VF 16 For instruction: store i32 %v1, i32* %out1, align 4

0 commit comments

Comments
 (0)