mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
1e97683a06
The generic cost of logical or/and reductions should be cost of bitcast <ReduxWidth x i1> to iReduxWidth + cmp eq|ne iReduxWidth. Differential Revision: https://reviews.llvm.org/D97961
47 lines
3.6 KiB
LLVM
47 lines
3.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
|
|
; RUN: opt < %s -mtriple=riscv32 -cost-model -cost-kind=throughput -analyze | FileCheck %s --check-prefix=RISCV32
|
|
; RUN: opt < %s -mtriple=riscv64 -cost-model -cost-kind=throughput -analyze | FileCheck %s --check-prefix=RISCV64
|
|
|
|
define i32 @reduce_i1(i32 %arg) {
|
|
; RISCV32-LABEL: 'reduce_i1'
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 66 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 132 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
|
|
; RISCV32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
|
|
;
|
|
; RISCV64-LABEL: 'reduce_i1'
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 130 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
|
|
; RISCV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
|
|
;
|
|
%V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
|
|
%V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
|
|
%V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
|
|
%V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
|
|
%V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
|
|
%V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
|
|
%V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
|
|
%V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
|
|
ret i32 undef
|
|
}
|
|
|
|
declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
|
|
declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
|