; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8m.main < %s | FileCheck %s --check-prefix=V8M ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple=armv8a-linux-gnueabihf < %s | FileCheck %s --check-prefix=NEON ; RUN: opt -passes="print" -cost-kind=all 2>&1 -disable-output -mtriple=armv8.1m.main -mattr=+mve < %s | FileCheck %s --check-prefix=MVE target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" define i32 @reduce_i1(i32 %arg) { ; V8M-LABEL: 'reduce_i1' ; V8M-NEXT: Cost Model: Found costs of 1 for: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:3 CodeSize:2 Lat:2 SizeLat:2 for: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:5 CodeSize:2 Lat:2 SizeLat:2 for: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:9 CodeSize:2 Lat:2 SizeLat:2 for: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:17 CodeSize:2 Lat:2 SizeLat:2 for: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:33 CodeSize:2 Lat:2 SizeLat:2 for: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:65 CodeSize:2 Lat:2 SizeLat:2 for: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of RThru:129 CodeSize:2 Lat:2 SizeLat:2 for: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef) ; V8M-NEXT: Cost Model: Found costs of 1 for: ret i32 undef ; ; NEON-LABEL: 'reduce_i1' ; NEON-NEXT: Cost Model: Found costs of 3 for: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of 2 for: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of 2 for: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of 2 for: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of 2 for: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of RThru:97 CodeSize:2 Lat:2 SizeLat:2 for: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of RThru:193 CodeSize:2 Lat:2 SizeLat:2 for: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of RThru:385 CodeSize:2 Lat:2 SizeLat:2 for: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef) ; NEON-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef ; ; MVE-LABEL: 'reduce_i1' ; MVE-NEXT: Cost Model: Found costs of 4 for: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:3 CodeSize:2 Lat:2 SizeLat:2 for: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:3 CodeSize:2 Lat:2 SizeLat:2 for: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:3 CodeSize:2 Lat:2 SizeLat:2 for: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:3 CodeSize:2 Lat:2 SizeLat:2 for: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:257 CodeSize:2 Lat:2 SizeLat:2 for: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:513 CodeSize:2 Lat:2 SizeLat:2 for: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:1025 CodeSize:2 Lat:2 SizeLat:2 for: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef) ; MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef ; %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef) %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef) %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef) %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef) %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef) %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef) %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef) %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef) ret i32 undef }