[llvm] 4f578e9 - [AArch64] Update bswap cost test. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 05:53:22 PDT 2023


Author: David Green
Date: 2023-07-20T13:53:18+01:00
New Revision: 4f578e9407ea95d474db3b7ddbffb95d5bfd336c

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

LOG: [AArch64] Update bswap cost test. NFC

See D155806

Added: 
    

Modified: 
    llvm/test/Analysis/CostModel/AArch64/bswap.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/CostModel/AArch64/bswap.ll b/llvm/test/Analysis/CostModel/AArch64/bswap.ll
index aaffb473c245ce..8b387cf01adcd9 100644
--- a/llvm/test/Analysis/CostModel/AArch64/bswap.ll
+++ b/llvm/test/Analysis/CostModel/AArch64/bswap.ll
@@ -9,81 +9,54 @@ declare i16 @llvm.bswap.i16(i16)
 declare i32 @llvm.bswap.i32(i32)
 declare i64 @llvm.bswap.i64(i64)
 
-declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>)
 declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>)
-
-declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
-declare <4 x i32> @llvm.bswap.v4i32(<4 x i32>)
 declare <8 x i16> @llvm.bswap.v8i16(<8 x i16>)
-
-define i16 @bswap_i16(i16 %a) {
-; CHECK-LABEL: 'bswap_i16'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bswap = tail call i16 @llvm.bswap.i16(i16 %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %bswap
-;
-  %bswap = tail call i16 @llvm.bswap.i16(i16 %a)
-  ret i16 %bswap
-}
-
-define i32 @bswap_i32(i32 %a) {
-; CHECK-LABEL: 'bswap_i32'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bswap = tail call i32 @llvm.bswap.i32(i32 %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %bswap
-;
-  %bswap = tail call i32 @llvm.bswap.i32(i32 %a)
-  ret i32 %bswap
-}
-
-define i64 @bswap_i64(i64 %a) {
-; CHECK-LABEL: 'bswap_i64'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %bswap = tail call i64 @llvm.bswap.i64(i64 %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %bswap
-;
-  %bswap = tail call i64 @llvm.bswap.i64(i64 %a)
-  ret i64 %bswap
-}
-
-define <2 x i32> @bswap_v2i32(<2 x i32> %a) {
-; CHECK-LABEL: 'bswap_v2i32'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %bswap = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %bswap
-;
-  %bswap = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %a)
-  ret <2 x i32> %bswap
-}
-
-define <4 x i16> @bswap_v4i16(<4 x i16> %a) {
-; CHECK-LABEL: 'bswap_v4i16'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %bswap = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %bswap
-;
-  %bswap = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %a)
-  ret <4 x i16> %bswap
-}
-
-define <2 x i64> @bswap_v2i64(<2 x i64> %a) {
-; CHECK-LABEL: 'bswap_v2i64'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %bswap = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %bswap
-;
-  %bswap = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %a)
-  ret <2 x i64> %bswap
-}
-
-define <4 x i32> @bswap_v4i32(<4 x i32> %a) {
-; CHECK-LABEL: 'bswap_v4i32'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %bswap = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %bswap
-;
-  %bswap = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %a)
-  ret <4 x i32> %bswap
-}
-
-define <8 x i16> @bswap_v8i16(<8 x i16> %a) {
-; CHECK-LABEL: 'bswap_v8i16'
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %bswap = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %a)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %bswap
-;
-  %bswap = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %a)
-  ret <8 x i16> %bswap
+declare <16 x i16> @llvm.bswap.v16i16(<16 x i16>)
+declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>)
+declare <4 x i32> @llvm.bswap.v4i32(<4 x i32>)
+declare <8 x i32> @llvm.bswap.v8i32(<8 x i32>)
+declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
+declare <4 x i64> @llvm.bswap.v4i64(<4 x i64>)
+declare <3 x i32> @llvm.bswap.v3i32(<3 x i32>)
+declare <4 x i48> @llvm.bswap.v4i48(<4 x i48>)
+
+define void @scalar() {
+; CHECK-LABEL: 'scalar'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %b16 = call i16 @llvm.bswap.i16(i16 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %b32 = call i32 @llvm.bswap.i32(i32 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %b64 = call i64 @llvm.bswap.i64(i64 undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+  %b16 = call i16 @llvm.bswap.i16(i16 undef)
+  %b32 = call i32 @llvm.bswap.i32(i32 undef)
+  %b64 = call i64 @llvm.bswap.i64(i64 undef)
+  ret void
+}
+
+define void @neon() {
+; CHECK-LABEL: 'neon'
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v4i16 = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %v8i16 = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 58 for instruction: %v16i16 = call <16 x i16> @llvm.bswap.v16i16(<16 x i16> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2i32 = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %v4i32 = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %v8i32 = call <8 x i32> @llvm.bswap.v8i32(<8 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %v2i64 = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v4i64 = call <4 x i64> @llvm.bswap.v4i64(<4 x i64> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %v3i32 = call <3 x i32> @llvm.bswap.v3i32(<3 x i32> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %v4i48 = call <4 x i48> @llvm.bswap.v4i48(<4 x i48> undef)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+  %v4i16 = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> undef)
+  %v8i16 = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> undef)
+  %v16i16 = call <16 x i16> @llvm.bswap.v16i16(<16 x i16> undef)
+  %v2i32 = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> undef)
+  %v4i32 = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> undef)
+  %v8i32 = call <8 x i32> @llvm.bswap.v8i32(<8 x i32> undef)
+  %v2i64 = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> undef)
+  %v4i64 = call <4 x i64> @llvm.bswap.v4i64(<4 x i64> undef)
+
+  %v3i32 = call <3 x i32> @llvm.bswap.v3i32(<3 x i32> undef)
+  %v4i48 = call <4 x i48> @llvm.bswap.v4i48(<4 x i48> undef)
+  ret void
 }


        


More information about the llvm-commits mailing list