From d42f222f9d6f01afe99d0d597c98b36eb205c5ec Mon Sep 17 00:00:00 2001 From: David Green Date: Wed, 27 Apr 2022 13:30:50 +0100 Subject: [PATCH] [AArch64] Add some larger shuffle cost tests. NFC --- .../CostModel/AArch64/shuffle-other.ll | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll b/llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll index 8d07557cb360..feb3c29fa6fe 100644 --- a/llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll +++ b/llvm/test/Analysis/CostModel/AArch64/shuffle-other.ll @@ -10,6 +10,7 @@ define void @shuffle() { ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v11 = shufflevector <2 x i16> undef, <2 x i16> undef, <2 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v12 = shufflevector <4 x i16> undef, <4 x i16> undef, <4 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v13 = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v10b = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v14 = shufflevector <2 x i32> undef, <2 x i32> undef, <2 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v15 = shufflevector <4 x i32> undef, <4 x i32> undef, <4 x i32> ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v16 = shufflevector <2 x float> undef, <2 x float> undef, <2 x i32> @@ -24,6 +25,7 @@ define void @shuffle() { %v11 = shufflevector <2 x i16> undef, <2 x i16> undef, <2 x i32> %v12 = shufflevector <4 x i16> undef, <4 x i16> undef, <4 x i32> %v13 = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> + %v10b = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> %v14 = shufflevector <2 x i32> undef, <2 x i32> undef, <2 x i32> %v15 = shufflevector <4 x i32> undef, <4 x i32> undef, <4 x i32> @@ -159,3 +161,48 @@ define void @insert_subvec() { ret void } + +define void @multipart() { +; CHECK-LABEL: 'multipart' +; CHECK-NEXT: Cost Model: Found an estimated cost of 42 for instruction: %v16a = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v16b = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v16c = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 84 for instruction: %v16d = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v32a = shufflevector <4 x i32> undef, <4 x i32> undef, <4 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %v32a4 = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %v32idrev = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %v32many = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %v32many2 = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %v323 = shufflevector <3 x i32> undef, <3 x i32> undef, <3 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64a = shufflevector <2 x i64> undef, <2 x i64> undef, <2 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v64b = shufflevector <2 x i64> undef, <2 x i64> undef, <2 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v64ab = shufflevector <4 x i64> undef, <4 x i64> undef, <4 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %v64d = shufflevector <4 x i64> undef, <4 x i64> undef, <4 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f64a = shufflevector <2 x double> undef, <2 x double> undef, <2 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f64b = shufflevector <2 x double> undef, <2 x double> undef, <2 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f64ab = shufflevector <4 x double> undef, <4 x double> undef, <4 x i32> +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %v16a = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> + %v16b = shufflevector <8 x i16> undef, <8 x i16> undef, <8 x i32> + %v16c = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> + %v16d = shufflevector <16 x i16> undef, <16 x i16> undef, <16 x i32> + + %v32a = shufflevector <4 x i32> undef, <4 x i32> undef, <4 x i32> + %v32a4 = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> + %v32idrev = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> + %v32many = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> + %v32many2 = shufflevector <16 x i32> undef, <16 x i32> undef, <16 x i32> + %v323 = shufflevector <3 x i32> undef, <3 x i32> undef, <3 x i32> + + %v64a = shufflevector <2 x i64> undef, <2 x i64> undef, <2 x i32> + %v64b = shufflevector <2 x i64> undef, <2 x i64> undef, <2 x i32> + %v64ab = shufflevector <4 x i64> undef, <4 x i64> undef, <4 x i32> + %v64d = shufflevector <4 x i64> undef, <4 x i64> undef, <4 x i32> + + %f64a = shufflevector <2 x double> undef, <2 x double> undef, <2 x i32> + %f64b = shufflevector <2 x double> undef, <2 x double> undef, <2 x i32> + %f64ab = shufflevector <4 x double> undef, <4 x double> undef, <4 x i32> + + ret void +}