[llvm] f041338 - [X86][Costmodel] Add SSE2 sub-128bit vXi32/f32 stride 2 interleaved store costs

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 18 05:54:17 PDT 2021


Author: Simon Pilgrim
Date: 2021-10-18T13:46:10+01:00
New Revision: f04133815360bfbb9c81eaa993845bf5d7dc473c

URL: https://github.com/llvm/llvm-project/commit/f04133815360bfbb9c81eaa993845bf5d7dc473c
DIFF: https://github.com/llvm/llvm-project/commit/f04133815360bfbb9c81eaa993845bf5d7dc473c.diff

LOG: [X86][Costmodel] Add SSE2 sub-128bit vXi32/f32 stride 2 interleaved store costs

Differential Revision: https://reviews.llvm.org/D111941

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll
    llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 341bf069b60c..cb83f3c17a3c 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -5325,7 +5325,6 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCost(
       {2, MVT::v16i16, 4}, // interleave 2 x 16i16 into 32i16 (and store)
       {2, MVT::v32i16, 8}, // interleave 2 x 32i16 into 64i16 (and store)
 
-      {2, MVT::v2i32, 1},   // interleave 2 x 2i32 into 4i32 (and store)
       {2, MVT::v4i32, 2},   // interleave 2 x 4i32 into 8i32 (and store)
       {2, MVT::v8i32, 4},   // interleave 2 x 8i32 into 16i32 (and store)
       {2, MVT::v16i32, 8},  // interleave 2 x 16i32 into 32i32 (and store)
@@ -5412,6 +5411,8 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCost(
 
       {2, MVT::v2i16, 1},  // interleave 2 x 2i16 into 4i16 (and store)
       {2, MVT::v4i16, 1},  // interleave 2 x 4i16 into 8i16 (and store)
+
+      {2, MVT::v2i32, 1},  // interleave 2 x 2i32 into 4i32 (and store)
   };
 
   if (Opcode == Instruction::Load) {

diff  --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll
index 5783ca224193..2c7f244717ab 100644
--- a/llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll
+++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-f32-stride-2.ll
@@ -13,13 +13,13 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: LV: Checking a loop in "test"
 ;
 ; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction:   store float %v1, float* %out1, align 4
-; SSE2: LV: Found an estimated cost of 6 for VF 2 For instruction:   store float %v1, float* %out1, align 4
+; SSE2: LV: Found an estimated cost of 2 for VF 2 For instruction:   store float %v1, float* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 14 for VF 4 For instruction:   store float %v1, float* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 28 for VF 8 For instruction:   store float %v1, float* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 56 for VF 16 For instruction:   store float %v1, float* %out1, align 4
 ;
 ; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction:   store float %v1, float* %out1, align 4
-; AVX1: LV: Found an estimated cost of 6 for VF 2 For instruction:   store float %v1, float* %out1, align 4
+; AVX1: LV: Found an estimated cost of 2 for VF 2 For instruction:   store float %v1, float* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 15 for VF 4 For instruction:   store float %v1, float* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 38 for VF 8 For instruction:   store float %v1, float* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 76 for VF 16 For instruction:   store float %v1, float* %out1, align 4

diff  --git a/llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll b/llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll
index 3055f7e1038a..ad2b8bfa94bc 100644
--- a/llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll
+++ b/llvm/test/Analysis/CostModel/X86/interleaved-store-i32-stride-2.ll
@@ -13,13 +13,13 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: LV: Checking a loop in "test"
 ;
 ; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction:   store i32 %v1, i32* %out1, align 4
-; SSE2: LV: Found an estimated cost of 14 for VF 2 For instruction:   store i32 %v1, i32* %out1, align 4
+; SSE2: LV: Found an estimated cost of 2 for VF 2 For instruction:   store i32 %v1, i32* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 30 for VF 4 For instruction:   store i32 %v1, i32* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 60 for VF 8 For instruction:   store i32 %v1, i32* %out1, align 4
 ; SSE2: LV: Found an estimated cost of 120 for VF 16 For instruction:   store i32 %v1, i32* %out1, align 4
 ;
 ; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction:   store i32 %v1, i32* %out1, align 4
-; AVX1: LV: Found an estimated cost of 9 for VF 2 For instruction:   store i32 %v1, i32* %out1, align 4
+; AVX1: LV: Found an estimated cost of 2 for VF 2 For instruction:   store i32 %v1, i32* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 19 for VF 4 For instruction:   store i32 %v1, i32* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 46 for VF 8 For instruction:   store i32 %v1, i32* %out1, align 4
 ; AVX1: LV: Found an estimated cost of 92 for VF 16 For instruction:   store i32 %v1, i32* %out1, align 4


        


More information about the llvm-commits mailing list